title: Undo a fast-forward merge
body: <p>I've made some changes to my git repo that I wish to undo.</p>
  
  <p>My git repo looked like this:</p>
  
  <pre><code>A-B----     master
     \   /
      C-D     * develop
  </code></pre>
  
  <p>I was on the <code>develop</code> branch, forgot that it differed from the <code>master</code> branch, made a change on <code>develop</code>, merged it into <code>master</code>, and then pushed to my remote (called <code>publish</code>).</p>
  
  <p>Because there were no changes on master since B (common ancestor), git did a fast-forward merge.</p>
  
  <p>Now, my repo looks like this:</p>
  
  <pre><code>A-B-C-D   master, develop, remotes/publish/master, remotes/publish/develop.
  </code></pre>
  
  <p>I wanted to revert the last merge, restoring <code>master</code> to B.</p>
  
  <p>From what I read in <a href="https://stackoverflow.com/questions/927358/undo-last-git-commit">How to undo last commit(s) in Git?</a>, I used <code>git reset sha-of-B</code> to restore my <code>master</code> branch to revision B.</p>
  
  <p>Questions:</p>
  
  <ul>
  <li>How do I restore <code>develop</code> to revision D?</li>
  <li>How do I then push these changes back to remote/publish?</li>
  </ul>