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.