Cursor deleting entire files when I reject one line changes

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

This is a really really brutal one, Cursor keeps completely deleting entire files when I reject single line diff edits that it makes to an existing file. Really brutal if I have some uncommitted changes to that file too, since the only thing I think I can do is just ask it to bring them back and hope it brings them back as what they were..

Steps to Reproduce

Unclear, it doesn’t happen every time, but it happens quite often. I have an existing file, I prompt some small edit to it, then in the green/red diff approval line I reject, and then the tab closes and the file is deleted..

Expected Behavior

Don’t delete my file

Operating System

MacOS

Version Information

Version: 2.4.27
VSCode Version: 1.105.1
Commit: 4f2b772756b8f609e1354b3063de282ccbe7a690
Date: 2026-01-31T21:24:58.143Z
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.2.0

For AI issues: which model did you use?

Auto

Does this stop you from using Cursor

Yes - Cursor is unusable

2 Likes

I have file deletion protection on too..

Hey, thanks for the report.

There’s an identical thread with an active discussion here: Rejecting suggested changes can delete the entire file

Urgent, to protect your data:

  • Commit to Git before you accept changes from the agent
  • If the file was already deleted, try restoring 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>
  • Another option is Timeline view (bottom left in Explorer), pick the last good version

Until this is fixed, it’s best to commit to Git more often.

A post was merged into an existing topic: Rejecting suggested changes can delete the entire file