Reset
All types of reset will move the HEAD
pointer to the commit specified.
The difference is what happens to the working tree and the staging index.
--soft
: no rollback on either.--mixed
: keep the working tree, roll back the staging index; default option;--hard
: roll back both, like subsequent commits never happen. It's likegit checkout
with an attachedHEAD
.
Right after the hard reset, if you have the SHA you can still get to later commits. But if you do further development, subsequent commits might be lost.
Last updated