Rejecting file edits can delete entire file

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When I reject AI modifications in a file that was initially created by the AI, the whole file is sometimes deleted instead of reverting only the proposed changes.

Steps to Reproduce

Ask Cursor to create a file and accept the changes.
Ask Cursor to modify that file.
Reject the changes in the editor UI by clicking “Undo ⌘N”.
Observe file unexpectedly deleted and unrecoverable.

Expected Behavior

Rejecting an edit should preserve the original file contents without the modification.

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 2.4.27
VSCode Version: 1.105.1
Commit: 4f2b772756b8f609e1354b3063de282ccbe7a690
Date: 2026-01-31T21:24:58.143Z (1 mo ago)
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 23.2.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, this is a known bug that was fixed in version 2.5. You’re on 2.4.27, update Cursor and the issue should go away.

If the file is already deleted, you can restore it via:

  • Git: git checkout -- <file_name>
  • Checkpoints: open the chat where the deletion happened, find the message right before it, and click Restore Checkpoint
  • Timeline: Explorer > Timeline bottom left, then pick the last good version

More details in the main thread: Rejecting suggested changes can delete the entire file

Let me know if it happens again after updating.

1 Like

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