pub fn undo() -> Result<()>
Restore the most recent snapshot: reset branch tips and metadata to their pre-mutation state. Refuses on a dirty worktree (it resets the current branch) and consumes the snapshot so it is one-shot.