gitgit-tower

Deleting commits using Git Tower


I was attempting to completely delete a commit I just made and I'm trying to figure out how to do it inside of git tower. I had clicked on the Make a collection commit and did revert but not sure if that was right. So what I want to do is have the commit with the subject Include recipes from course teacher as the most recent commit and delete the two above it. Thoughts on how I can do this?


Solution

  • If the commit you want to delete is the last one, you have to do a git reset --hard pointing the previous commit. The revert create another commit to delete changes, not really deleting the commit.

    WARNING, you will loose all files of your working tree. If you have some, stash them.

    If you already push the commit you want to delete, I advise you to keep the revert, otherwise you will have to push force. See there : Git delete commit