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
If you just messed up your last commit (wrong message, forgot to add some changes) and want to fix it before pushing it to a public repo why not use:
git commit --amend -m "New message here"
If you have newly staged changes they'll be combined with the last commit (that you're trying to get rid of) and will replace that commit.
Of course if you amend a commit after you've pushed it, you're rewriting history so if you do that be sure to understand the implications.
You can also pass the '--no-edit' option instead of '-m' if you would prefer to use the previous commit's message.
Docs: http://git-scm.com/docs/git-commit.html