Delete commits from a branch in Git
Asked 07 September, 2021
Viewed 3K times
  • 53
Votes

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 will not push to the remote branch.

I read git help, and I think the command I should use is git reset --hard HEAD. Is this correct?

30 Answer