Claude Code deleted my files: what can still come back
Last updated: 7 October 2026
A Claude Code turn ran rm, git reset --hard or git clean, and files are gone. Work through the sections below in order: the first one only applies if turnslip was installed. Until you are done, let nothing else write to that folder, Claude included.
If turnslip was already installed
Run /turnslip:undo now, if the deleting turn was the last one; with Pro, /turnslip:undo 3 takes back an earlier turn. turnslip snapshots the project before and after every turn, so it brings back files a shell command deleted. It helps only if it was installed before the turn. Its limits: it never reads paths your .gitignore excludes, so a gitignored .env is not among them; on the first turns in a new or very large project a turn can run in light mode, where shell changes are not tracked yet and the slip says so; files over 5 MB are not kept. If you did not have it, read on: everything below works without it.
In this captured turn, /turnslip:undo then answered "restored 2 files", and the build folder was back (Claude Code 2.1.292).
1. git
git status"displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file", so a deleted file git knows about shows up there.git restorerestores "specified paths in the working tree"; without other options the contents come from the index, the copy git keeps of your last commit plus anything you staged.git restore path/to/filebrings back one file,git restore .every one.- After
git reset --hardor a deleted branch, look atgit reflog: reflogs "record when the tips of branches and other references were updated", andHEAD@{2}means "where HEAD used to be two moves ago". Find the entry from before the turn and rungit reset --hard HEAD@{n}with its number. - If Claude ran
git stash,git stash listlists the stash entries andgit stash popapplies the latest one again.
What git cannot bring back: changes it never recorded. Work you neither committed nor staged is not in the index or in any commit, so after git reset --hard or git checkout -- . it is gone for good. Work you had staged may still be in git’s object store: Pro Git says that when you run git add and git commit, Git "stores blobs for the files that have changed", and git fsck --lost-found will "Write dangling objects into .git/lost-found/commit/ or .git/lost-found/other/"; "If the object is a blob, the contents are written into the file".
2. Claude Code's /rewind
/rewind restores edits Claude made with its own file editing tools. It does not bring back what a shell command deleted. Claude Code's checkpointing documentation says so directly: "Checkpointing does not track files modified by Bash commands." Its example is a turn that runs rm file.txt: "These file modifications cannot be undone through rewind."
3. Your editor's local history
VS Code keeps a local history of the files you save in it: "Depending on your settings, every time you save an editor, a new entry is added to the list." A deleted file can be brought back with Local History: Find Entry to Restore in the Timeline view. It is on by default and skips files over 256 KB. If you use another editor, check whether it keeps a history of its own.
4. Backups and synced folders
Look in the Trash (macOS) or the Recycle Bin (Windows). If the folder is covered by Time Machine, Windows File History or a sync service that keeps old versions, restore the folder from there to a separate location and copy back what you need.
5. Recovery software
Recovery tools look for deleted data still left on the drive. On an SSD with TRIM they usually find nothing usable: in a 2010 test of recovery tools, small files "recovered fine on the non-TRIM" drive "and not whatsoever on the TRIM", and the verdict was: "Recovering data from a TRIM-erased drive is just not going to happen." If you try anyway, run the tool from another drive and save what it finds to another drive.
Next time
Commit before a large request, so git has something to return to. Make Claude Code ask before destructive commands: how to stop Claude Code from running rm -rf and git reset --hard. And keep a record of every turn that you can undo, shell commands included: that is what turnslip does, free.
Related: How to undo Claude Code changes · All guides · Install turnslip, free