There are two branches that branched from master : develop, and foo. Both develop and foo diverged from master by several commits.
foo has been merged unto develop. Now foo and develop points to the same merge commit, i.e two "streams" of commits meet into this merge commit (apologies for approximate vocabulary).
The code in this merge commit is exactly as it should be. There is nothing that should be undone.
Now let's say that nobody will ever want to checkout any of the previous commit of foo. So, we would like to "delete" these commits (i.e. not undo the modification these commit brought, just not having them in the history. In fact, looking at the history, it would look as if foo never existed, and the merge commit is no longer the meeting points of two "streams of commit").
Certainly it would have been better if foo had been squashed before merged into develop, but this did not happen.
Attempting to rebase/squash foo after the merge required to solve some conflicts. Since the code is exactly as it should be in the merge commit, solving conflicts should not be required (disclaimer: may be that this rebase was not attempted in the proper way).
Is there a way to do this ?
To rewrite the head commit of
develop: