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):
-
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).
-
Start new work:
- Modify ONE file only.
- Only that single file appears in the diff file list (expected behavior).
-
Click Undo on that single file.
-
Immediately:
- ALL previously touched files from earlier agent history suddenly reappear in the diff view.
- Within seconds, those files are removed from disk.
-
Result:
git statusshows 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