The Practice Room / The Terminal with Claude Code / Episode 9

The Terminal with Claude Code

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.

By MstimajPublished 25 November 20263 min read2 readsLevel Start HereTool Claude Code

Sign in to save your place and mark this done. Free, no card.

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.

The escape key pressed twice, with the input box empty
Twice, with the box empty.

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.

The Claude Code rewind screen, showing the most recent message and how many sit above it
The rewind screen, sitting on the current point.

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:

  1. Restore code and conversation
  2. Restore conversation, which rewinds the chat and leaves your files exactly as they are
  3. Restore code, which puts the files back and keeps everything you discussed
  4. Summarize from here
  5. Summarize up to here
The confirm screen with five numbered restore options
The confirm screen, with all five options.

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.

Next walkthroughClaude Code cannot generate images, but it can write one
On your machineWant this set up on your own computer, with your own files?

Book a session and we do it together on a call.

Book an hour

Ask 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.

Comments are read before they appear.

The newsletter

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.