Re:A Requiem for a Dying Operating System (1994)
by Joker_vD on Friday September 04, 2020 @09:03AM
(#24374536)
It's the command that does "Reset working directory/Discard changes/Revert to last commit"! You'd think that's what "git reset" would to, but of course not.
[ Parent
| on HN ]
Re:A Requiem for a Dying Operating System (1994)
by jlokier on Friday September 04, 2020 @10:20AM
(#24375131)
> You'd think that's what "git reset" would to, but of course not.
Ahem, the command for "Reset working directory/Discard changes/Revert to last commit" is "git reset --hard".
That's the one I use.
"git checkout -f" does the same thing, but only because their different functionality coincides when there are no other arguments. When given a non-HEAD commit-id or branch-id they do different things.