From @learningwithcole
Undo anything Claude did: checkpoints
- Make sure the prompt box is empty. If there's text, Esc Esc clears it; press ↑ to get it back.
- Press Esc Esc, or type
/rewind./checkpointand/undowork too. - Pick the message from just before things went wrong.
- 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.
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.