← home

$ git undo --generator

the exact command for your mess — pick, copy, done

1 · where is the commit?
2 · what about the changes?
3 · run this
git reset --mixed HEAD~1

last 1 commit undone — changes kept but unstaged

The long version — what each flag actually does to history, the working tree and the reflog — lives in git undo last commit (keep changes) and git revert vs reset. Stash first, ask later: git stash a single file. The full recovery map: Undo Anything in Git · also on this site: Run LLMs Locally.