Why it matters
git reset --hard is one keystroke from losing work. Most undo questions have a safer command that people don't know.
Choose the situation and copy the steps, with a warning where history is rewritten.
How to use it
- Type or paste your input; the example shows the format.
- Press Show commands. Results also update as you type.
- Read the summary line, then the table, notes or output below it.
- Copy or download what you need. Nothing leaves this page.
FAQ
reset vs revert?
reset moves your branch back (rewrites history). revert adds a new commit that undoes one, safe after pushing.
Can I recover after reset --hard?
Usually, if it was committed: git reflog shows where HEAD was.
Is my input uploaded?
No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.
Can I rely on the result?
It follows the public specification or formula named on this page and says where it simplifies. Check anything critical against the official tool or documentation before you ship it.