title: Amalgamate two merges in Git
body: <p>I have a Git branch which is a <code>topic</code> branch that shows the project <code>master</code>. I merged it with the master and resolved a conflict manually. After that, a critical bug was fixed in <code>master</code> and I merged again, this time without conflict. I did not commit anything myself between the two merges and I have not pushed the branch to anyone else. I would like to combine the two merges.</p>
  
  <p>What I have now is:</p>
  
  <pre><code>master ----A---B-----C----------&gt;
                  \     \
  topic   ---W-----X-----Y--------&gt;
  </code></pre>
  
  <p>Where:</p>
  
  <ul>
  <li>X is the merge where a conflict was fixed</li>
  <li>C is the critical bug fix on master</li>
  <li>Y is the merge incorporating this fix</li>
  </ul>
  
  <p>I would like to make this into:</p>
  
  <pre><code>master  ----A---B---C-----------&gt;
                       \
  topic   ----W---------X'--------&gt;
  </code></pre>
  
  <p>Where X' is now a merge incorporating the conflict resolution and the bugfix in a single merge commit.</p>
  
  <p>I know I could do it manually by checking out W and merging <code>master</code>, and copying the contents of the resolved files from X during the inevitable conflict. Is there a quicker way with less chance of messing it up (in the case that the conflict was large and ugly)?</p>