I accidentally committed a change with Git, pushed it up to GitHub, and have done several commits afterward. I need to erase that commit from the history. I realize this could possibly hose other forks and I'm ok with that.
I was able to modify my history locally with a command like:
git rebase --onto HEAD~4 HEAD~3 HEAD
which seemed to work fine. However, I don't then know how to get that changed history pushed appropriately back to github.
I managed to accomplish the whole process a different way after some messing around:
git rebase -i <commit>^
... delete first commit in editor ...
git push -f
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With