Claude Code Rewind Not Undoing Changes?
Prepared and checked using AI. Sources are linked in the article.
Claude Code rewind not undoing changes usually means those changes fall outside its checkpoints. /rewind tracks edits made through Claude’s file editing tools, rather than every filesystem change. Shell commands and external edits are outside that guarantee.
Which changes can rewind restore?
The key distinction is how the change happened:
| Change | Checkpoint coverage |
|---|---|
| Direct edits through Claude’s tools | Changes through Write, Edit, and NotebookEdit are tracked |
| File changes through Bash | Not tracked, including shell-based deletions, moves, copies, and rewrites |
| Manual edits or another concurrent session | Normally not captured, unless they touch files already edited in the current session |
| Subagent edits | Generally restored only in files the main conversation already edited; a foreground skill with context: fork is the exception |
Even edits made through Claude’s file editing tools can remain: rewind skips symlinked and hard-linked files, and restoration can fail if the checkpoint’s snapshots have expired or been discarded.
A tracked file is not an isolated container for one author’s edits. Preserve manual work before rewinding when multiple actors have touched the same file.
For example, suppose Claude directly edits src/parser.ts, then runs a formatter through Bash on other files. Rewind can restore the tracked edit while the formatter’s changes remain. The request came from one conversation, but the changes used different mechanisms.
Choose a code restore action
Run /rewind, select the prompt before the unwanted work, then choose:
- Restore code to undo tracked edits and keep the conversation.
- Restore code and conversation to rewind both.
- Restore conversation to leave current files unchanged.
Code restore options appear only when the selected checkpoint has tracked changes. A mid-turn message marked No code restore has no checkpoint of its own; select the prompt that started that turn.
The keyboard alternative is pressing Esc twice with an empty prompt. With text in the prompt, double Esc clears the draft instead.
Inspect and recover the changes that remain
Pause other writers before recovery. In a Git repository, start with:
git status --short --untracked-files=all
git diff
git diff --cached
git status --short --untracked-files=all lists changed paths and individual untracked files; ignored files are excluded. git diff shows unstaged changes, while git diff --cached shows staged changes. Inspect both before choosing what to discard.
Use a Git restore only when the chosen source contains the version you want. For example, take src/settings.ts as a tracked file whose desired baseline is the latest commit:
git restore --source=HEAD --worktree -- src/settings.ts
--source=HEAD --worktree restores the named working-tree path from the latest commit without restoring the index. This discards all working-tree edits to that path, including wanted changes made before the Claude session. It does not reconstruct an uncommitted pre-session version.
To select individual changes interactively instead:
git restore --patch --source=HEAD -- src/settings.ts
If you deliberately want both the staged and working-tree versions replaced:
git restore --source=HEAD --staged --worktree -- src/settings.ts
Review untracked files separately and preserve anything valuable before removing it. For an uncommitted version absent from checkpoints and Git, look for an independent backup or editor history.
For future tasks, keep a known baseline before broad shell operations and use separate worktrees for concurrent agents. See how to run multiple Claude Code agents in parallel and how to review AI-generated changes.
Where Parallel Code fits
Parallel Code is our free, open-source desktop app for macOS and Linux. It runs several AI coding agents in parallel, each isolated in its own git worktree, and provides a diff-first review surface. It fits workflows where you want separate working copies for agents and a clear view of the changes you intend to keep.