Undo deletes file created by Agent after multiple edits

Hey, thanks for the report. This is a known bug: Undo on files created by the agent deletes the entire file instead of undoing the last change. The team has already confirmed and logged it.

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

For now, the workaround is to avoid using Ctrl+Z on files the agent just created. If you need to roll back changes, it’s better to use Restore Checkpoint in chat (the button in the agent message context menu).

Your report helps with prioritization.