I would like to know how to delete a commit.
By delete
, I mean it is as if I didn\'t make that commit, and when I do a push in the future, my changes wi
Forcefully Change History
Assuming you don't just want to delete the last commit, but you want to delete specific commits of the last n commits, go with:
git rebase -i HEAD~
, so git rebase -i HEAD~5
if you want to see the last five commits.
Then in the text editor change the word pick
to drop
next to every commit you would like to remove. Save and quit the editor. Voila!
Additively Change History
Try git revert
. Revert will create a new commit that undoes the specified commit.