Recipes · Chapter 44 of 63
Undo With Checkpoints and Rewind
Restore a Kiro checkpoint in the IDE, rewind a CLI conversation into a new session, and know exactly which edits checkpoints do not track.
All levels 2 min read last reviewed 2026-09-04
◎ Learning objective
Recover from a bad agent run using the right undo tool for your surface, and know its limits.
Kiro takes a checkpoint automatically every time you send a prompt. When a run goes wrong, you restore that checkpoint instead of un-picking edits by hand.
When to use this
Restore a checkpoint when the agent changed files you did not want changed. Use rewind when the files are fine but the conversation went down the wrong path and you want to try a different approach from an earlier turn. Neither replaces a commit before a risky session.
Steps
- Commit before a big agent run. This costs five seconds and covers everything checkpoints do not.
- Work normally. Kiro creates a checkpoint on every prompt with no action from you. In the IDE, the checkpoint markers appear in the conversation.
- When a run goes wrong in the IDE, find the checkpoint marker before the prompt that caused the problem and choose Restore. Your files and the agent’s context go back to that point, and the chat after it is discarded.
- Use the IDE’s revert of the last turn when only the most recent turn was wrong. It is the smaller, faster version of the same idea.
- In the CLI, use rewind instead when you want a different approach rather than an undo. Rewind forks the conversation at an earlier turn into a new session. Your files are untouched, so the code stays where it is while the conversation restarts from a better point.
- Treat CLI checkpoints as experimental. They exist in CLI V3 and are marked experimental in Kiro’s documentation, so do not build a workflow on them yet.
- Use
git diffafter any restore. That is how you find out what the checkpoint did not cover.
Check it worked
After restoring, open one of the files the agent changed and confirm it matches the earlier state. Then run git status. Anything still modified was changed by something checkpoints do not track: your own edits, a formatter, an MCP tool, or a shell command. That gap is the single most important thing to know about checkpoints.
Common problems
- A file did not come back. It was not changed by the agent’s built-in file tools. Manual edits, formatter output, MCP tool writes, and shell command effects are all outside the snapshot.
- The chat you wanted is gone. Restoring discards the conversation after the checkpoint. Copy anything you need first.
- There is no checkpoint on your surface. Kiro Web and the mobile app do not have checkpoints. Cloud sessions also do not offer local-file affordances such as checkpoints.
- You wanted the conversation back, not the files. That is rewind, and it is CLI only.
- The restore did not fix the build. A shell command installed or deleted something. Re-run your setup steps, or reset from git.
Related
- Compact a long session covers the other one-way operation to understand before you use it.
- Fix a bug with a bugfix spec pairs well with checkpoints during a risky fix.
- Kiro CLI Guide lists the session commands.
Frequently asked questions
How do I undo what Kiro's agent did?
In the IDE, restore the checkpoint created before the prompt that went wrong. Kiro creates one automatically on every prompt. Restoring puts the agent-changed files and the agent context back and discards the chat after that point. The IDE also offers a revert of the last turn.
What is the difference between rewind and restoring a checkpoint?
Restoring a checkpoint changes your files back. Rewind, which is CLI only, forks the conversation at an earlier turn into a new session and leaves your files exactly as they are. Use rewind to retry a different approach, and a checkpoint to undo the edits.
Do checkpoints track everything?
No. They snapshot only files the agent changed with its built-in file tools. Your own manual edits, formatter runs, writes made by MCP tools, and anything a shell command did are not tracked. Commit often; git is the real safety net.
☰ Chapter summary
- Kiro creates a checkpoint automatically on every prompt and snapshots the files the agent changed with its built-in tools.
- Restoring a checkpoint puts those files and the agent context back, and discards the later chat.
- Checkpoints are supported in the IDE and are experimental in CLI V3; Web and Mobile do not have them.
- Rewind is CLI only: it forks the conversation at an earlier turn into a new session and leaves files untouched.
- Manual edits, formatter runs, MCP tool writes, and shell commands are not tracked, so git stays your real safety net.
All chapter summaries are collected on the revision page.
Related chapters
- RecipesCompact a Long SessionUse /compact in Kiro CLI, understand what automatic compaction keeps and summarises, and tune compaction.excludeMessages before you hit a context limit.
- RecipesFix a Bug With a Bugfix SpecUse a Kiro bugfix spec so the analysis lands in bugfix.md, a regression test comes before the fix, and the reason for the bug survives in the repo.
- Hands-onKiro CLI GuideInstall kiro-cli, drive sessions with slash commands, manage agents and context, and take the agent into scripts and CI.
- ConceptsAgentic DevelopmentAgentic development means the AI plans and performs multi-step work. How Kiro's agent loop, autonomy modes, permissions, and checkpoints work.