Skip to content

Instantly share code, notes, and snippets.

@citizen428
Created July 9, 2018 04:00
Show Gist options
  • Save citizen428/e670d90a8bed43e392e1012dd6fd1ad8 to your computer and use it in GitHub Desktop.
Save citizen428/e670d90a8bed43e392e1012dd6fd1ad8 to your computer and use it in GitHub Desktop.
git reset HEAD~2 # undo last two commits, keep changes
git reset --hard HEAD~2 # undo last two commits, discard changes
@eyadsibai
Copy link

how can u get the hashes that's the question!

@OranShuster
Copy link

OranShuster commented Jul 31, 2018

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