-
-
Save citizen428/e670d90a8bed43e392e1012dd6fd1ad8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reset HEAD~2 # undo last two commits, keep changes | |
git reset --hard HEAD~2 # undo last two commits, discard changes |
how can u get the hashes that's the question!
like @O5ten said, through git reflog
if you do this right after the reset it's very easy to find the lost hash
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
--hard resets the working tree yes,, but the commit is not permanently lost.
git reflog
can still save your bottocks in that situation. And if you have the hashes of those commits then you can still easily cherry-pick those commits by hash. :)