Three places at Mr. Harun’s studio: the album (HEAD), the tray (the index), the desk (the work tree). See how far --soft, --mixed and --hard reach, and call a…
Why it matters
A reset in the wrong mode, --hard above all, is the most common way beginners lose work. Once you see the three places move, you know --soft and --mixed only relocate, only --hard overwrites, and a "lost" photo can still be called back through the reflog.
The key idea
A reset moves the ribbon back, its mode says how far
Common mistakes
After reset --hard, all uncommitted work is gone Only --hard overwrites the work tree, and changes never committed or stashed are recorded nowhere. Before --hard, git commit or git stash first, or use --mixed.
An important commit seems to vanish after a reset A reset only moves the ribbon. git reflog records HEAD’s old positions, and git reset --hard ORIG_HEAD (or HEAD@{1}) brings it back with the same number.
Pushing after a reset messes up the team’s history A reset rewrites history: the commits left behind still sit in other people’s albums. For commits already shared, use git revert (a new commit that undoes the change), not reset.
Try it in this playground
Go back with --soft The ribbon moves back, the undone photo’s content waits in the tray.
Go back with --mixed (the default) The tray is refilled too, the change stays on the desk.
--hard with a desk not clean What was never shot or stashed is gone from the desk.
Bring a photo back through ORIG_HEAD or the reflog The ribbon slides back to the same photo, the same number.