The Practice Room / The Terminal with Claude Code / Episode 9
How to undo what Claude Code changed
Claude Code edits the real files on your computer, and it has a rewind. Press the escape key once and it only interrupts the run. Press it twice, with the box empty, and a screen opens that walks back through your own messages and offers five ways to put things back.
Claude Code edits the real files on your computer. There is a way to put them back, and to put the conversation back with them, and it lives behind one key.
This page is the written version of the walkthrough.
The key, and how many times you press it
It is the escape key, and the count is the part that matters.
Press it once and it interrupts whatever Claude is doing. That is a useful thing in its own right, but nothing is undone and nothing comes back. If this is the only press you have ever tried, it is reasonable to conclude there is no undo.
Press it twice, with the box you type in empty, and a different screen opens. If there is text in the box, the key does its other job instead, so clear the box first.
What opens
The screen says Rewind, and underneath it: Restore the code and/or conversation to the point before…
It starts on where you are now, marked (current), and tells you how many of your own messages sit above it. At the foot: Enter to continue, Esc to cancel. Nothing has happened yet.
Stepping back through what you sent
Press the up arrow and you walk back through your own messages, one at a time. Each entry carries what that message changed:
- prices.csv +29 means that message resulted in a file edit, and how large it was.
- No code changes means that one only moved the conversation along.
That second line is what makes the screen usable. You are not guessing which message caused the damage. You can see which ones touched anything at all.
The confirm screen
Land on the message you want to go back to and it asks you to confirm. It quotes the message back, says how long ago you sent it, and states two things plainly: the conversation will be forked, and how many lines of code will be restored, in which file.
Then five choices:
- Restore code and conversation
- Restore conversation, which rewinds the chat and leaves your files exactly as they are
- Restore code, which puts the files back and keeps everything you discussed
- Summarize from here
- Summarize up to here
The one thing it will not do
The screen states the limit itself: rewinding does not affect files edited manually or via bash.
So if you opened a file in your editor and typed in it, or a terminal command wrote to it, that work is outside what the rewind tracks. It follows what Claude changed using its own tools, and nothing else.
Treat it as a seatbelt for the session you are sitting in. It is not a replacement for saving your work, and if the project matters it should be in version control as well.
Why it is worth knowing
The value is not really the undo itself. It is what a reliable way back does to the way you work.
When taking something off again costs two keystrokes, you let it attempt the restructure you are unsure about, or the approach you would normally talk yourself out of. The cost of being wrong drops, so you try more things, and trying more things is how the useful ones turn up.
What she says in the film
Do you want to rewind something you said to Claude Code?
Not undo one file. Go back to how everything was before you asked.
It is the escape key, and it matters how many times you press it.
Press it once and it only stops Claude working. Nothing is undone and nothing comes back.
Press it twice, with the box you type in empty, and a different screen opens.
It says rewind, and it offers to restore the code and the conversation to the point before.
It starts on where you are now, and tells you how many of your messages sit above it.
Press the up arrow and you walk back through everything you sent, one message at a time.
Each one shows what it changed. Some touched a file. Some changed no code at all.
Land on the message you want to go back to, and it asks you to confirm.
It quotes the message, says how long ago you sent it, and tells you the conversation will be forked.
Then five choices. Restore the code and the conversation, or one without the other, or summarise from that point, or up to it.
And it tells you the limit plainly. Rewinding does not affect files you edited by hand, or through a command.
Knowing the way back is what lets you try the messy idea, because taking it off again is two presses.
Subscribe.
No permission required.
Book a session and we do it together on a call.
Book an hourAsk what did not make sense
Comments go through our own form and are read before they appear. Links are not allowed; describe it in words.
More from The Terminal with Claude Code.

Install Claude Code in one line
Claude Code is an assistant that can read and edit the files on your computer.

How to use Claude Code in the terminal, for the first time
Two films ago we installed it. Last time we made it show its plan. Today it makes something.

Claude Code plan mode, and the shift+tab shortcut
Last time we installed Claude Code. Before you let it change anything, there is one thing worth knowing.
Words used in this piece.

What is a terminal, and why do AI tools use it?
A terminal is a window where you type commands as text and the computer answers in text; AI coding tools live…

Claude Code vs Cursor vs Codex: which one for a non-coder?
Claude Code and Codex are agents that run in a terminal and work on the files in a folder; Cursor is a code ed…
Get the next walkthrough.
One email when something goes up. The argument, the film and the term, nothing else. One click to leave.
Have a question now? Ask Mstimaj, she knows the archive.