title: Rebased with merge conflicts: How to undo?
body: <p>I was working on a feature branch B that I had branched out from master a month ago. As other new features came in, the master branch kept getting updated. </p>
  
  <p>This is how master branch looks like right now:</p>
  
  <pre><code>1 -&gt; 2 -&gt; 3 -&gt; 4 -&gt; 5 -&gt; 6 -&gt;7 
  </code></pre>
  
  <p>When I had first branched out, it looked like this:</p>
  
  <pre><code>1 -&gt; 2 -&gt; 3
  </code></pre>
  
  <p>This is how my feature branch (B) looks like right now:</p>
  
  <pre><code>x -&gt; y -&gt; z
  </code></pre>
  
  <p>Now that I am ready to push my new feature to master, I was advised to first rebase from master, and then create a PR.</p>
  
  <p>While doing <code>git rebase</code>, my branch encountered a merge conflict with a couple of files. I thought I'll just keep the incoming changes and the rebase will proceed normally. However, me resolving the conflicts converted the entire "REBASE MASTER" step to a sort of "MERGE MASTER". AKA: It applied the commits that had already been merged into master into my feature branch, not something I initially intended to do with <code>git rebase</code>.</p>
  
  <p>This is how my feature branch looks like right now:</p>
  
  <pre><code>x -&gt; 4 -&gt; 5 -&gt; 6 -&gt; y -&gt; 7 -&gt; z
  </code></pre>
  
  <p>This is what I wanted to achieve (but didn't):</p>
  
  <pre><code>1 -&gt; 2 -&gt; 3 -&gt; 4 -&gt; 5 -&gt; 6 -&gt;7 -&gt; x -&gt; y -&gt; z
  </code></pre>
  
  <p>How do I go back? This has already been pushed to the remote branch, so I can't simply delete my local branch and fetch from origin again. </p>
  
  <p>One way I can think of is to branch out from master again, and create a feature branch C. Then, cherry-pick commits from B to C. Once I am sure C is a complete copy of B (and only contains the commits I want), I can delete B. Am I missing something? Or is there a better/faster way?</p>