Cursor 2.4.31 broken Undo

Hey, thanks for the report. This is a known bug. Undoing changes in files created by the agent can sometimes delete the whole file instead of just reverting the changes.

A few users have reported this, and our team has confirmed it:

The team is aware and tracking it. No ETA yet, but reports like yours help us prioritize.

For now, if a file gets deleted this way, you can restore it using checkpoints. Open the chat where the agent made the changes, then use “Restore Checkpoint” to go back to the previous state.