Git: Delete a commit in a remote branch
For latest commit:
git reset --hard HEAD~1 /
git reset --hardgit push origin HEAD --force
For old commits:
- git rebase -i
- Change pick to drop for commits which you want to delete.
- Maybe resolve conflict and continue rebase
- Change a new message commit
- git push --force
Comments
Post a Comment