What happened
An agent working on a robotics simulator meant to reset a linked worktree and ran git checkout -- . with its shell still sitting in the main checkout, which held 22 modified files from the previous session.
Why it happened
The command was the one for a worktree reset, but the shell was in the wrong directory. Git did what it was told and asked nothing, because that command never asks.
How it ended
The files came back only because they had been staged earlier, which left their blobs in the object database with no names attached.
The next day the repository added a helper that refuses to restore over uncommitted changes unless it saves a backup first, plus one line in the agent instructions saying to use it.






