Problem
electron/worktrees.js:2522-2526 runs git reset --hard <sha> directly when restoring a checkpoint. maybeCreateCheckpoint (worktrees.js:2393-2429) exists and is exactly the right safety net, but it is not invoked before the reset.
Impact
Any uncommitted work in the thread worktree (manual edits the user made in that folder, or changes from a run whose post-turn checkpoint silently failed, which is best-effort by design) is destroyed unrecoverably by one click on an older checkpoint.
Fix direction
Attempt maybeCreateCheckpoint(store, threadId) before the reset. One-line change plus a test.
Problem
electron/worktrees.js:2522-2526runsgit reset --hard <sha>directly when restoring a checkpoint.maybeCreateCheckpoint(worktrees.js:2393-2429) exists and is exactly the right safety net, but it is not invoked before the reset.Impact
Any uncommitted work in the thread worktree (manual edits the user made in that folder, or changes from a run whose post-turn checkpoint silently failed, which is best-effort by design) is destroyed unrecoverably by one click on an older checkpoint.
Fix direction
Attempt
maybeCreateCheckpoint(store, threadId)before the reset. One-line change plus a test.