-
Notifications
You must be signed in to change notification settings - Fork 1
Managing pushed git mistakes
Jared edited this page May 18, 2018
·
1 revision
Creates commit to revert the selected commit(s)
git revert {commit_id}
Reset remote to the parent of selected commit:
git push origin +{commit_id}^:{branch_name}
If you have the branch checked out locally, you can also do it in two simpler steps:
- First reset the branch to the parent of the current commit,
- then force-push it to the remote.
git reset HEAD^ --hard
git push origin -f