Rewind: Undoing Claude's Edits
Claude took the pause feature in a direction you dislike, across five files. You could untangle it by hand, or you could step back to the moment before it started. Claude Code keeps checkpoints for exactly this, but they have limits you need to know.
The rule
Rewind undoes Claude's file edits; git undoes everything else.
As Claude edits files, Claude Code saves checkpoints: snapshots of the files at each of your prompts. Rewind takes you back to one. Press Esc twice on an empty prompt, or use /rewind, choose an earlier message, and pick what to restore:
- Conversation and code: back to that moment entirely.
- Code only: the files return to how they were, but the conversation keeps what was learned from the dead end.
- Conversation only: the files stay as they are, and the chat goes back.
Checkpoints have firm limits:
- Changes made by shell commands, such as deleting a file with
rmor running a migration or script, are not tracked. - Edits you make outside Claude Code are not tracked.
- Nothing that has left your machine comes back: a push, a deployment, a message sent to customers, a change to a remote database.
Checkpoints are a quick "try again" inside a session. Git is your permanent history. Use both, and commit every time the code reaches a good state.
The shortcut
Ask "What made the change, and where does it live?" Claude's file edits in this session: rewind. Shell commands, your own edits or older work: git. Anything outside your machine: neither, which is why those actions deserve permission prompts in the first place.
The mess
Claude edited
orders.py,pricing.py,app.pyand two templates. It also ran a script that added a column to your local database.
The trap is treating rewind as a full undo button. It is an undo for one kind of change: files Claude edited through its own editing tools.
Drills
Answer fast — trust the rule.
Claude's last three file edits are wrong, but the conversation holds useful findings. What do you restore?
Claude ran rm data/menu.csv as a shell command. Will rewind bring the file back?
Why commit to git even though rewind exists?
Which of these can neither rewind nor git undo?
Remember
- Rewind undoes Claude's file edits; git undoes the rest of your local work.
- Shortcut: what made the change, and where does it live?
- Trap: expecting rewind to undo shell commands or anything that left your machine.
