First, I have to apologise - there are quite a number of 'how to undo a merge' questions on SO, but I'm so new at git that I really don't understand how to adapt the solutions them to my situation (though I'm sure they can be).
I have two branches, versionA and versionB. I made some changes in versionA and merged them into versionB, which is fine because the changes made in versionA are forwards compatible. Then, I think I must have accidentally merged versionB back into versionA, which is not fine because versionB is not backwards-compatible to versionA.
How can I undo this?
To make things clearer, this is what I've done:
versionA C--C--C--C'--M2
          \          /
           \        /
versionB C--M--C--C*
M: merged versionA into versionB. this is fine.
M2: accidentally merged versionB back into versionA
This is what I want:
versionA C--C--C--C'
          \         
           \       
versionB C--M--C--C*
If I were on Mercurial I'd do hg rollback and all would be fine, or I'd hg update C' and make future commits off there for the versionA branch, although this would leave M2 as a dead dangling head (hence I'd prefer the rollback method).
What is the git way to scrub that last commit M2 from the versionA branch? (All changes have been pushed).
 
     
    