Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Usage Best Practices  ›  Lesson

Rewind: Undoing Claude's Edits

Rewind 12 minCheckpoints let you rewind the conversation, the code Claude edited, or both, but shell-command changes and anything outside your machine need git or cannot be undone at all.

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 rm or 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 pause feature goes wrongStep 1 of 4
  1. The mess

    Claude edited orders.py, pricing.py, app.py and 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.

quick drill

Claude's last three file edits are wrong, but the conversation holds useful findings. What do you restore?

quick drill

Claude ran rm data/menu.csv as a shell command. Will rewind bring the file back?

quick drill

Why commit to git even though rewind exists?

quick drill

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.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainBack to a good state

Claude's attempt at the pause feature edited five files and also ran a script that added a column to your local database. Explain how you would get back to a good state, and which parts rewind can and cannot recover.