Double Esc does not undo everything
How to use Claude Code’s rewind to restore an earlier state of your code and conversation, what it cannot undo, and the habit that protects your project.
- built-in feature
- nothing to install
- for Claude Code
Published on
What rewind is
Every time you send a request that starts a new turn, Claude Code saves a checkpoint of your files as they were before that turn. Rewind is the menu that lets you go back to one of those checkpoints.
- It works on its own: there is nothing to turn on or install.
- Checkpoints are saved with the conversation. If you resume the session later, rewind is still available.
- Claude Code keeps file copies of the 100 most recent checkpoints in each session.
Open the menu
With the text box empty, press Esc twice. If you prefer, you can type the command instead:
/rewindNote
If the box has text, pressing Esc twice only clears what you had written. The text goes to your history: after you use the menu, press the up arrow to bring the text back.
Pick the checkpoint and what comes back
The menu lists the requests you made in the session. Select the checkpoint you want and choose an action:
Restore code and conversation- Returns both the code and the conversation to that point.
Restore conversation- Returns only the conversation to that point and keeps the code as it is.
Restore code- Returns only the files to that point and keeps the conversation.
Summarize from here / Summarize up to here- Summarizes part of the conversation to free up context space. Does not touch your files.
Never mind- Leaves the menu without changing anything.
Note
The two options that restore code only appear when that checkpoint has recorded file edits. When you go back in the conversation, the original request returns to the text box, ready for you to edit or resend.
What comes back and what stays out
Comes back
- Files that Claude edited with its own editing tools.
- Changes made by terminal commands to a file that Claude had already edited in that conversation.
- The conversation, if you choose that option.
Does not come back
- A file that was only changed by a terminal command, such as
rm(delete) ormv(move or rename). - Edits made by subagents, in most cases.
- Changes you made outside Claude Code or in another session at the same time.
- Files that are system shortcuts (symbolic links and hard links).
Example
If Claude runs rm b.txt in the terminal and has never edited that file, rewind does not bring b.txt back.
Make a commit before a big task
The official documentation itself says rewind is not a replacement for version control. Before asking for a big change, save the state of your project in Git. In the project folder, run:
git initgit add -A
git commit -m "before the big task"Tip
The git add -A command is what includes new files. Without it, a file that has never been added to Git is not saved in the commit.
If something was deleted or moved by the terminal
To see what changed since the last commit:
git statusTo bring back a deleted file that was in the commit (replace b.txt with the name of your file):
git restore b.txtCaution
git restore . returns all files to the state of the last commit and discards any change that has not been saved yet. Use it only when you are sure.
Before you trust rewind
- Checkpoints are deleted in the automatic cleanup, by default about 30 days after the session last saved one. To keep them longer, adjust the
cleanupPeriodDayssetting. - If the copies of a checkpoint have already been deleted, going back to it can fail with the message
No files were restored. - Use rewind for a quick undo inside the session and Git for real history.
Source
Official Claude Code documentation, Checkpointing page: code.claude.com/docs/en/checkpointing. Checked on November 7, 2026. The behavior may change in future versions.