Guides UNDO

The Claude Code safety-net cheat sheet

From the reel "Claude Code has an undo button"

Download PDF Watch the reel (opens in a new tab)

Facts checked 2026-10-23 against code.claude.com docs.

From @learningwithcole

Undo anything Claude did: checkpoints

  1. Make sure the prompt box is empty. If there's text, Esc Esc clears it; press ↑ to get it back.
  2. Press Esc Esc, or type /rewind. /checkpoint and /undo work too.
  3. Pick the message from just before things went wrong.
  4. Choose an option:
    • Restore code and conversation: as if it never happened
    • Restore conversation: keep the code, rewind the chat
    • Restore code: keep the chat, roll back the files
    • Summarize from here / up to here: shrinks context without touching files

What it does NOT undo:

  • File changes made by terminal commands Claude ran (e.g. a migration or rm), unless Claude had also edited that file with its edit tools
  • Edits you made yourself outside Claude Code
  • Most subagent edits
  • Symlinked files

Claude Code keeps the 100 most recent checkpoints per session; old snapshots are cleaned up after about 30 days.

Rule #1: commit before anything big

Checkpoints are not Git.

Terminal
git add -A && git commit -m "before Claude refactor"

If everything goes wrong: git restore ., or git reset --hard HEAD, which discards ALL uncommitted changes.

Plan before it touches files

Press Shift+Tab until you see plan mode, or type /plan fix the login bug. Claude reads the code and writes a plan, and edits wait until you approve it.

Ask a side question without derailing it

/btw what was that config file called? The answer pops up but doesn't go into the conversation.

Pick up where you left off

claude --continue resumes your last conversation. /resume lets you pick any older one.

That's the full UNDO guide.

Want the next one? Join the list to hear when new guides go live.

Email signup opens soon

Until it opens, follow @learningwithcole (opens in a new tab) for new guides.

Save as PDFBrowse every guide

Brand deals for AI companies: how to reach me.