Outcome. Pick between `restore`, `reset` and `revert` from where the change is and whether anyone else has it — and preview what each would discard.
Before you start: Understand what enters your next commit
The duration is an estimate of engaged work, not a timer — nothing here waits. Steps marked "Check" and "Practice" are verified in the browser; "Read" and "Lab" steps are yours to confirm.
Read the decision table and the `git reset` section that follows the revert one. The question to carry away: has anyone else got this commit?
- Predict
Predict: which command?
≈ 1 min✓ doneOne situation, one command.
In Practice Mode do "Discard an unstaged edit" first, then "Undo a commit that is already shared". The second one is what completes this step.
Scenario: Undo a commit that is already shared — completes automatically when the simulator's check passes.
HEAD is what `reset` moves; this check makes sure the model is in place.
Completes when the knowledge check on that page has been attempted.
Session complete
Next: Recover a deleted branch — The reflog you glimpsed in reset is the tool for the next recovery, and it is a 20-minute session.
Keep building your Git skills. Get one practical technique, one workflow, and one security lesson each week. Modern Git Weekly is not taking subscriptions yet — read thesample issue, or follow new lessons by RSS.
When you are done: Recover a deleted branch. The reflog you glimpsed in reset is the tool for the next recovery, and it is a 20-minute session.
How did this go?
Unexpected output. Compare your output with the expected block line by line; the first differing line is usually the cause. Then check the version-sensitive notes.
Missing prerequisite. Most "stuck" moments here come from one earlier concept. The prerequisites list names it; the learning path puts it in order.
Unclear explanation. Read the explanation section, then the mental model, then retry the step — the command usually makes sense once the model is in place.
Instructions did not match my environment. Check `git --version` and your shell (Git Bash vs PowerShell vs zsh). Platform notes on the page name the differences that matter; the verification step confirms you are back to a known state.
Good. The next step is to do it without the page open — or move to the recommended next activity below.
All help on this page: Git troubleshooting decision tree · Find the lesson that comes before this one · How Git works — the model behind the commands · Recover a lost commit (lab)