https://adamj.eu/tech/2024/09/02/git-avoid-reset-hard-use-keep/
@adamchainz In principle this makes a lot of sense, but in practice I find myself wanting to throw away uncommitted changes a lot more often than I want to keep them without committing or stashing them, so I'd say "avoid" is too strong here; it depends on your workflow. Ideally one should know about all the modes and when to use them. But I'd definitely agree that `git reset --hard` gets way more "press" than it deserves.
(On a separate note, my own pick for most underappreciated reset mode would be `git reset --mixed -N`)
@adamchainz
Nice! Subscribed to your blog!
@jelloeater Thank you! Enjoy the new Git post from today as well, and the 46 more in the archive! https://adamj.eu/tech/tag/git/
@adamchainz how is it different than `git reset` with no argument?
@drlazor8 'reset' is one of those weird dual-purpose commands - using it without arguments unstages files, so they won't be committed. This action is best done with the newer 'git restore' command, instead:
https://git-scm.com/docs/git-restore
I don’t cover this old way of using 'git reset' in my writing because it makes it harder to learn.