You do not need to add back B and C : they are already committed and will not be affected by your return, which will add new commits (negative image A ).
Another way is ( if you haven't pressed those commits yet ) to do an interactive reboot ( git rebase -i A^ ), and change the order of your commits, completely dropping A
You will see the following parameters in your rebase (see git Book )
# Commands:
But then again, this will change your story and make you git push -force, which is not always a good idea if other people have already pulled from your repo.
In this case, refund remains the safest solution.
source share