turnslip

How to undo Claude Code changes

Last updated: 5 October 2026

Claude Code changed something you did not want: a file rewritten, a file deleted by rm, a dependency installed. There are three ways back, and each one restores different things. This page says what each one covers, so you can pick the right one before you need it.

1. Claude Code's own rewind

Claude Code keeps a checkpoint before each prompt that starts a turn. Run /rewind, or press Esc twice when the prompt input is empty, pick a message, then choose to restore the code, the conversation, or both.

What it covers, from Claude Code's checkpointing documentation:

What it does not cover, in the documentation's words: "Checkpointing does not track files modified by Bash commands." So a file Claude removed with rm, moved with mv, or changed through npm install or a script does not come back. Edits by most subagents, changes made outside Claude Code and symlinked files are not restored either. The documentation's own advice: checkpoints are "Not a replacement for version control."

2. git

If you committed before you asked Claude for something, git can take everything back: git restore . for changed files, git clean for new ones (look with git clean -n first). git stash keeps your own uncommitted work out of the way while you do it.

Its limits:

3. turnslip

turnslip is a Claude Code plugin. It snapshots the project at the start and at the end of every turn and compares the two, so a file changed by a shell command counts as much as one Claude edited. One line under each reply says what changed; /turnslip:undo takes the last turn back.

Its limits, said plainly:

Which one to use

Commit before a big request, whatever else you use. For a quick step back in the same session, /rewind also rewinds the conversation. When Claude runs commands, and you want to see what changed before you decide, turnslip covers the shell changes the other two can miss. They work side by side.

Related: What did Claude Code just change? · Install turnslip, free