AI deletes entire source files when rejecting suggested edits

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

While rejecting a set of AI-suggested edits in Cursor, a source file that should not have been deleted ended up removed from disk and staged for deletion in git. This caused subsequent builds to fail due to a missing compilation unit.

Steps to Reproduce

Open a git repository in Cursor.
Use the AI assistant to make edits across multiple files including at least one .cpp/.c file.
Use Cursor’s UI to reject the proposed AI changes (revert/reject changes for that edit set).
Check the working tree and git status.

Expected Behavior

Rejecting AI changes should restore the workspace to its previous state:
No files deleted unless explicitly requested
No deletions staged in git unless explicitly requested
Builds should not break due to missing source files

Operating System

Linux

Version Information

Version: 2.4.36 (user setup)
VSCode Version: 1.105.1
Commit: f9919bf991f247689f9ead605b5c5a3239a2a790
Date: 2026-02-12T21:00:33.976Z
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: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

GPT-5.2

For AI issues: add Request ID with privacy disabled

28118e88-4594-455e-a9d1-00861f484923

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, this is a known issue and we’re already tracking it. Here’s the main thread with details and discussion: Rejecting suggested changes can delete the entire file

There’s no fix yet, but here’s how to protect your data:

  1. Commit to git before accepting or rejecting agent changes
  2. If the file was already deleted, restore it via Checkpoints (open the chat where the change happened, find the message right before the deletion, click Restore Checkpoint) or via git: git checkout -- <file_name>
  3. You can also try the Timeline view (bottom left in Explorer) and pick the last working version

I’ve logged your Request ID, it’ll help with the investigation. The team is aware of the issue.

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