I have 5 local unpushed commits and I want to delete commit #3 from the tree, so parent of commit #4 would point to commit #2
How would I do that?
An image describing what I mean:
I have 5 local unpushed commits and I want to delete commit #3 from the tree, so parent of commit #4 would point to commit #2
How would I do that?
An image describing what I mean:
you can use
git rebase -i
:allows you to interactively choose which of the last (5 in this case) commits you wish to use, edit, squash,...
You will get a file to edit; like this:
in which you will just delete the line pointing to the commit you don't want anymore.. Note that you can do much more with the interactive rebase :)