Paths Subjects Questions Quizzes Pricing Search
Intermediate Open Free

What /rewind Can't Recover After a Bash Deletion

While working in Accept Edits mode, Claude Code runs rm old-script.sh through the Bash tool to remove a file it determined was unused. The file was never committed to git — it was new and still untracked.

The developer wants that file back. Which of the following correctly describes their actual recovery options?

Solution

The correct answer is "Only git, and only if the file was already tracked."

Checkpointing only snapshots changes made through Claude Code's own file-editing tools — Edit and Write. A deletion performed via rm through the Bash tool is invisible to checkpointing entirely, so /rewind has no snapshot of that file to restore, under any of its restore options. Since the file was also never committed to git, there's no git history to check out either — git checkout and git reflog can only bring back something git actually has a copy of. In this specific scenario (Bash-deleted, never committed), there is no built-in Claude Code or git mechanism that recovers the file.

"/rewind → Restore code" only undoes Edit/Write changes, not Bash changes, so it doesn't apply here. "/rewind → Restore conversation" never touches file state at all — it only rewinds the conversation. And leaving Accept Edits mode changes future approval behavior; it has no effect on a deletion that already happened.

Share this question

← Back to Claude Code Fundamentals practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.