简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM