Part 2 of 6 · Chapter 3 of 4

Every Way to Undo, and Which One You Want

Four commands undo four different things and the internet recommends them interchangeably. Name what you regret first — a file, a staging decision, a commit, a pushed commit — and the right command falls out of the answer.

Intermediate13 min read

Worth reading first: Making a Commit Worth Reading


Make a free account to read on

Every chapter is free — an account is how your progress, XP, and streak follow you from your laptop to your phone, and how you show up on the leaderboard. No payment, no trial.