title: Moving from one git branch to another and applying only my changes
body: <p>I've forked a project (from branch A), and it seems that for some reason it was continued in another branch(B).</p>
  
  <p>I tried to merge my fork (M) with the new branch (B), but that has resulted a lot of conflicts. The conflicts are because the new branch (B) has forked older branch (O) and part of the changes of A were not committed to B.</p>
  
  <p>Now I would like all my changes (in branch M) to be merged with the new branch B with no conflicts, canceling all changes made by A to the origin O in my fork M.</p>
  
  <p><a href="https://i.stack.imgur.com/qJlHU.png" rel="nofollow"><img src="https://i.stack.imgur.com/qJlHU.png" alt="enter image description here"></a></p>
  
  <p>what I want is in red. How do I do that?</p>