undo git reset

git reset soft HEAD~1 // undo last commit but keep the change

git reset hard HEAD~1 // undo last commit and discard the committed change

Undo the commit:

git reflog
3f6db14 HEAD@{0}: HEAD~: updating HEAD
d27924e HEAD@{1}: checkout: moving from d27924e0fe16776f0d0f1ee2933a0334a4787b4c
git reset HEAD@{1} (or git reset d27924e)

REF:

http://stackoverflow.com/questions/927358/how-do-you-undo-the-last-commit

http://stackoverflow.com/questions/2510276/undoing-git-reset

Advertisements