Keyword UNDOClaude Code

The Claude Code safety-net cheat sheet

From the reel “Claude Code has an undo button”

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.

Checked 2026-10-23 against code.claude.com docs.

Want the next one?

Every reel comes with a free guide like this one.

Join the list and get it when it goes up. You never need to sign up to read a guide.

Kit signup form · not connected yet

The email form lands here soon. Until then, new guides show up on Instagram first.

Follow @learningwithcole on Instagram (opens in a new tab)

Related guides

Keyword PLANposts Oct 29

The Claude Code plan mode cheat sheet

Comment PLAN, and I'll send you my plan mode cheat sheet, with three copy-paste planning prompts.

  • Claude Code
  • Workflows
Guide goes live when the reel posts