Bug Report: File created in Agent chat gets unexpectedly deleted after Undo All

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Summary
When continuously chatting in an Agent dialog, a new file generated by the current conversation is completely deleted after I perform Undo All on later changes. The file is removed entirely instead of only reverting content edits.

Steps to Reproduce

1.Open a persistent Agent chat dialog in Cursor.
2.Generate a new file within this chat (not modifying an existing file). The file is created and saved normally.
3.Continue chatting and make additional edits in the same context.
4.Run Undo All to revert all recent changes.
5.The file created earlier in this chat is deleted entirely from the project.

Expected Behavior

Undo All should only revert code/content changes, not delete newly created files.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

Version: 2.4.31 (user setup)
VSCode Version: 1.105.1
Commit: 3578107fdf149b00059ddad37048220e41681000
Date: 2026-02-08T07:42:24.999Z
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?

auto

For AI issues: add Request ID with privacy disabled

a5bb005f-d512-4c77-9afc-402ece470c1c
f841d07e-222f-4bd0-8888-59a9c50ce7a8

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report. This is a known bug. Undo on files that the agent created deletes the whole file instead of rolling back the changes. It’s already confirmed and logged.

The same bug is discussed here: Undo suggestion deletes entire file after accepting a created file

For now, it’s best not to use Ctrl+Z or Undo All on files the agent just created. If you need to revert changes, use Restore Checkpoint from the agent message menu in chat.

Hey there.

This will be fixed in the next update of 2.5. Appreciate the report.

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