Created
August 3, 2013 20:13
-
-
Save ursuleacv/6147833 to your computer and use it in GitHub Desktop.
How to undo the last Git commit?
This file contains hidden or 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 log # to see the last commit id | |
git reset --hard 5a7404742c85 | |
#or | |
#git reset --hard HEAD^ # use --hard if you don't care about keeping the changes you made | |
git commit -am 'restoring the file I removed on accident' | |
git push origin master --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment