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

**URL:** <https://forum.cursor.com/t/clicking-undo-after-agent-finishes-work-deletes-the-file-in-which-the-changes-where-made/152139>\
**Category:** Bug Reports\
**Tags:** checkpoints, review\
**Created:** [February 17, 2026, 8:13pm UTC](https://forum.cursor.com/t/clicking-undo-after-agent-finishes-work-deletes-the-file-in-which-the-changes-where-made/152139 "2026-02-17T20:13:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jovanvel](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jovanvel](https://forum.cursor.com/u/jovanvel)\
**Post date:** [February 17, 2026, 8:13pm UTC](https://forum.cursor.com/t/clicking-undo-after-agent-finishes-work-deletes-the-file-in-which-the-changes-where-made/152139/1 "2026-02-17T20:13:50Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [February 18, 2026, 6:17am UTC](https://forum.cursor.com/t/clicking-undo-after-agent-finishes-work-deletes-the-file-in-which-the-changes-where-made/152139/3 "2026-02-18T06:17:11Z")

</div>

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](https://forum.cursor.com/t/rejecting-suggested-changes-can-delete-the-entire-file/150500)

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.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [February 18, 2026, 6:17am UTC](https://forum.cursor.com/t/clicking-undo-after-agent-finishes-work-deletes-the-file-in-which-the-changes-where-made/152139/4 "2026-02-18T06:17:34Z")

</div>

Split this topic on February 18, 2026, 6:17am UTC

A post was merged into an existing topic: [Rejecting suggested changes can delete the entire file](https://forum.cursor.com/t/rejecting-suggested-changes-can-delete-the-entire-file/150500)

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [February 18, 2026, 6:17am UTC](https://forum.cursor.com/t/clicking-undo-after-agent-finishes-work-deletes-the-file-in-which-the-changes-where-made/152139/5 "2026-02-18T06:17:41Z")

</div>

Closed on February 18, 2026, 6:17am UTC


