Clicking undo after agent finishes work deletes the file in which the changes where made

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

After the agent has finished making changes, we can review them, or in the chat, keep all changes or undo all changes.

Clicking undo deletes the file in which the changes are made!.

I am not sure if this was isolated incident or happens consistently, but happened 2 times to me today, in as many tries as I clicked undo. I thought it is serious enough to report.

To be clear: the file was not freshly created by the agent. It existed prior to asking the agent to make changes.

Steps to Reproduce

Ask the agent to make a change in a single file. Once it is finished - click undo in chat to undo all changes. Observe the file disappear!

Expected Behavior

The changes should be undone, and the file kept as it was prior to the agents work.

Operating System

MacOS

Version Information

Version: 2.5.14
VSCode Version: 1.105.1
Commit: 9bda0059a130a70126468c18165a0e49ce979160
Date: 2026-02-15T17:48:47.664Z
Build Type: Stable
Release Track: Early Access
Electron: 39.3.0
Chromium: 142.0.7444.265
Node.js: 22.21.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.2.0

For AI issues: which model did you use?

Opus 4.6

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, this is a known issue. Undo or Reject can sometimes delete the whole file instead of rolling back changes. A few users have already reported it, and the team is aware.

Main thread with details: Rejecting suggested changes can delete the entire file

If your file already got deleted, here are a few ways to restore it:

  1. Checkpoints: Open the chat where the agent made changes, find the message right before the deletion, then click Restore Checkpoint.
  2. Git: git checkout -- <file_name>
  3. Timeline: In Explorer (bottom left), pick the last working version of the file.

As a precaution, I’d recommend committing before accepting or rolling back agent changes.

Let me know if there’s anything else.

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