On another note, I love how HN can go from complex research papers I struggle to keep up with, to explaining git commands the next day — something I learned within my first month of Git and never had a problem with again. How bipolar.
"git reset --patch" is useful for unraveling changes that were wrongly combined into a single commit.
However, I just find it easier to start from scratch if I changed 4 files at once, wanted the changes spread out over 3 commits, and I did those in the wrong order or something.
> Really hard to take anything you say seriously when you use the entire aplhabet for your hexadecimal SHA1 examples.
Touche.
Everything has been crystal clear since. I highly recommend it if you use git.
[0] https://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified
In the last example (which is actually the most common case in practice), they give wrong instructions. They should only revert the bad commit, not all the following commits. Reverting everything is impractical and useless, and if you want to do that you may as well use revert (which is still a bad idea).