Let's say I have a git repo with such a commit history: ABCDE
Now, all of a sudden, I realize that commits B and C are completely erroneous and unnecessary. Also, let's say I have complete freedom to rewrite the history of the project (perhaps I am working on the project alone).
I have another branch pointing to commits B and C, so losing them is not a problem. If I really need these changes, I can check this thread and see them.
But for the main branch, I would like to make the story be A-D'-E ', where D and E not only have a list of changed parents, but also do not contain the changes that were introduced by commits B and C.
Can this be done? And if so, how?
source
share