Critical Data Loss Bug – Undo Deletes Files on SSH Remote Workspace

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Clicking Undo on a single modified file causes ALL previously touched files in the agent history to reappear in the diff view and then get deleted from disk.

This results in:

  • Git-tracked files being marked as deleted
  • Untracked files being permanently deleted
  • Loss of local uncommitted changes

This is reproducible and causes real data loss.

Environment:

  • Workspace: SSH Remote
  • Remote OS: Linux (ext4)
  • Repo: Git
  • Cursor version: (fill in)
  • Local OS: (fill in)

Steps to Reproduce

Reproduction Flow (Precise Sequence):

  1. Work with Agent across many files over time.

    • Agent reads/modifies multiple files.
    • Eventually finish work.
    • Diff file list becomes empty (no pending changes shown in Cursor).
  2. Start new work:

    • Modify ONE file only.
    • Only that single file appears in the diff file list (expected behavior).
  3. Click Undo on that single file.

  4. Immediately:

    • ALL previously touched files from earlier agent history suddenly reappear in the diff view.
    • Within seconds, those files are removed from disk.
  5. Result:

    • git status shows many files as deleted.
    • Untracked files are permanently gone.
    • Local git changes are lost.
      Observed Behavior:
  • Undo on a single file triggers restoration of historical agent session state.
  • Files that were not part of the current change are pulled back into the diff view.
  • Those files are then deleted from disk.
  • inotify logs show MOVED_FROM events (atomic move behavior).
  • Deleted files match entries in ~/.cursor/ide_state.json → recentlyViewedFiles.

Expected Behavior

undo of a single agent addition should revert only the touched file and not deleting the entire files list that was in the agent history

Operating System

MacOS

Version Information

Version: 2.4.37
VSCode Version: 1.105.1
Commit: 7b9c34466f5c119e93c3e654bb80fe9306b6cc70
Date: 2026-02-12T23:15:35.107Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 25.3.0

Additional Information

i am sorry i don’t have screenshots… but i already have an inotify deamon in order to try to restore files us soon as it happen as i got a lot of file lost

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report.

We’re already tracking the issue where undo deletes files instead of reverting changes. A few users have hit similar behavior in recent versions:

In your case there’s an important detail. It also affects SSH remote workspaces, where the agent session’s historical state leaks into the undo scope.

As a temporary workaround until we ship a fix, please make frequent commits before rolling back agent changes. That way git checkout or git restore can recover anything that gets deleted.

Let me know if you need anything else.

there is any estimation on the bug fix release? it actually make it dangerous to work with Cursor… as i said - it deletes also files not tracked by git

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.