AI tools4 min readBy DanManREALPublished Updated
Undo Claude Code changes with rewind
In this guide
The short version
- Press Esc twice in an empty message box to open Claude Code's rewind menu.
- Rewind does not reliably restore shell deletions or moves; shell-only files are not tracked.
- A version history lets you return to any saved version, so save before big requests.
- Keep Claude Code asking before it acts, and check risky actions before they run.
Guide

Claude Code changed something you did not want changed. Maybe a page looks wrong, a feature broke, or a whole approach went sideways. Most of its edits can be undone in a few seconds, if you know where to look.
This guide covers the built-in rewind, what it cannot reverse, and the habit that lets you go back to your last saved version.
The quick fix: rewind
Before each message you send, Claude Code saves a snapshot of the files it is about to edit. These save points let you step back:
- Make sure the message box is empty, then press Esc twice to open the rewind menu.
- Pick the message that started the work you want to undo.
- Choose Restore code (that means your project's files). You can restore the conversation too, so the assistant also forgets the wrong turn.
Which restore to pick depends on what went wrong. Restore the code but keep the conversation when the plan was right and only the edit was bad. Restore both when the whole direction was wrong. Restoring only the conversation leaves your files as they are, which helps when you just want to ask the question a different way.
What rewind cannot undo
| Change | Can rewind undo it? |
|---|---|
| Edits Claude Code made inside files | Yes, while the save points last |
| Files changed only by shell commands | No, unless Claude already edited and tracked that file |
| Files deleted, moved or copied by shell commands | Not reliably; use version control or backups |
| Edits by extra helper assistants Claude Code starts for side jobs | Usually not |
| Changes you made yourself, or that another Claude Code window made | Usually not |
| Anything that left your computer, like a published page or a sent email | No |
Anthropic, the company behind Claude Code, describes save points as quick recovery within a session (one sitting of work with the assistant), not a replacement for a real version history.
After any rewind, open the pages or files you care about and look at them before you carry on. If something is still wrong, it was probably changed in one of the ways rewind does not cover.
The safety net: a version history
Version control is a system that keeps every version of a project you choose to save, so you can return to any of them, one file at a time or all at once. Developers rely on it every day, and Claude Code works well alongside it.
The habit is simple: ask Claude Code to save a version before every big request, and again once you are happy with the result. Then you can go back to your last saved version, whatever tool changed the files, even after a deletion.
Asking the assistant to undo it
You can also just ask: "Undo the changes you made to this file in your last step." This works when the assistant still knows exactly what it changed. After a long session it is riskier, because it may rebuild the old version from memory and get details wrong.
If you do ask, name the files and the step. Ask it to tell you what it plans to change before it changes anything, then check the result before you carry on.
Stop risky changes before they happen
The best undo is the one you never need. Two habits help most:
- Keep Claude Code asking before it acts. It has settings for how much it asks before it runs things. On real projects, pick one that asks you first, and read each request before you approve it.
- Put a check in front of the dangerous actions. GIT_REAL, the free tool I built, answers one question before a risky action: what would this exact action, such as deleting new files or going back to an older version, put at risk? You or your assistant ask, and it replies with a clear allow or block and the reasons.
GIT_REAL works on projects that use version control. It is advice rather than a lock, so it helps when your assistant is told to check it first, and it is not a backup. If files are already gone, read Claude Code deleted my files for where to look.
Common questions
How do I undo changes Claude Code made?
Make sure the message box is empty, then press Esc twice to open the rewind menu. Pick the message that started the work you want to undo, and choose Restore code.
What can't Claude Code's rewind undo?
It cannot reliably restore files deleted or moved by shell commands, or undo anything already published or sent. Shell edits to a file Claude already tracked may be reversible; shell-only files are not tracked. Edits by extra helper assistants, changes you made yourself and changes from another Claude Code window usually cannot be undone either.
How long do Claude Code's save points last?
Save points stay with the conversation, so you can still rewind after you come back to it later. Claude Code clears old ones after a while, so do not count on them for long.
Should I restore the code, the conversation or both?
Restore the code but keep the conversation when the plan was right and only the edit was bad. Restore both when the whole direction was wrong. Restoring only the conversation leaves your files as they are.


