Created
March 21, 2018 19:29
-
-
Save srpatcha/cdb44178a7ca560c51ee4c3ca08b3331 to your computer and use it in GitHub Desktop.
Remove the latest commit in git repo
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 | |
git reset --hard HEAD~1 // for latest | |
git reset --hard <sha1-commit-id> // for commit ID or specific 5th commit HEAD~5 | |
git log | |
git push origin HEAD --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git reset --hard origin/branch // for remote reset but you your loose local changes