Created
September 13, 2016 15:57
-
-
Save thagler/baebf0a870c559093c70335a5992402d to your computer and use it in GitHub Desktop.
Remove the latest commit from a branch already pushed to origin
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
For a list of the most recent commits | |
`git log --pretty=oneline --abbrev-commit` | |
Go back 1 commit to remove | |
`git rebase -i HEAD~1` | |
replace ‘pick’ with ‘drop’ in that commit line and save (should be in vi) | |
`git push origin +my/branch-name` | |
Note: push +branch_name is like --force, but slightly less of a jerk about it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment