← Back to Blog

Recover Deleted Files from Cursor

Cursor's AI deleted your files or broke your code? Here's how to recover instantly and prevent it from happening again.

If You Have mrq Running

Recovery is one command:

$ mrq history

Recent Snapshots
────────────────────────────────────────────────────
  14:23:45  abc123  Refactored auth components
                    +89 lines, -234 lines across 12 files

  14:21:02  def456  Added login form validation
                    +45 lines, -3 lines across 2 files
────────────────────────────────────────────────────

$ mrq restore def456
✓ Restored to snapshot def456
✓ Current state backed up

That's it. Your files are back. Your current state is automatically backed up before restore, so you can recover it if needed.

You can also browse your history visually in the dashboard and copy the restore command from there.

Don't have mrq yet? Skip to setup to prevent this from happening again, or read on for other recovery options.

If You Don't Have mrq Yet

Your options are more limited. Here's what you can try:

Check Cursor's Undo

If the change just happened and you haven't closed the editor:

  • Try Cmd+Z (Mac) or Ctrl+Z (Windows) in affected files
  • Check if deleted files are still in your editor tabs
  • Look in your trash/recycle bin

This only works for simple, single-file cases. If Cursor modified multiple files or you've closed tabs, this won't help.

Check Git (If You Committed Recently)

git status                    # See what changed
git diff                      # Review the damage
git checkout -- .             # Discard all changes

The problem: Most developers don't commit during active AI sessions. You're iterating quickly, stopping to commit breaks your flow. If you haven't committed since before the damage, git can't help you.

This is exactly why mrq exists. It captures state automatically so you don't have to think about it.

Set Up mrq (30 Seconds)

Don't let this happen again. mrq runs silently in the background and captures every meaningful change:

npm install -g mrq-cli@latest
mrq login
mrq watch

Now every change is captured automatically. Next time Cursor does something unexpected, recovery is one command.

Why This Happens with Cursor

Cursor's Composer and Agent modes can modify many files at once. The AI doesn't hesitate or ask for confirmation. It sees a task and executes it fully.

This is usually what you want. But occasionally the AI misunderstands the task, takes an overly aggressive approach, or confidently deletes code it thinks is unused.

The solution isn't to use Cursor less aggressively. It's to have a safety net that captures state continuously so recovery is always trivial.

Related Resources

Never lose work to Cursor again

Automatic snapshots. Instant recovery. Set up in 30 seconds.

Get Started Free →