title: 'Fatal: cherry-pick failed' with Git
body: <p>I was working on a branch <code>X</code>. I made a commit and pushed it. </p>
  
  <p>Then I wanted to <code>cherry-pick</code> it to branch <code>Y</code>. But due to some unmerged files present, I got the following message:</p>
  
  <pre><code>error: 'cherry-pick' is not possible because you have unmerged files.
  hint: Fix them up in the work tree,
  hint: and then use 'git add/rm &lt;file&gt;' as
  hint: appropriate to mark resolution and make a commit,
  hint: or use 'git commit -a'.
  fatal: cherry-pick failed
  </code></pre>
  
  <p>Now, I just want to delete my branch <code>Y</code>, then re-create the branch <code>Y</code> and then want to manually edit the file where I was trying to cherry-pick.</p>
  
  <p>Currently, I'm unable to delete the branch as it is my working branch.
  I cannot <code>checkout</code> any other branch. I'm getting the following error on trying to change the branch. </p>
  
  <pre><code>mod/assign/locallib.php: needs merge
  error: you need to resolve your current index first
  </code></pre>
  
  <p>I just need to delete the branch <code>Y</code>, without losing anything on branch <code>X</code>.</p>
  
  <p><strong>EDIT #1</strong></p>
  
  <p>I edited the file <code>mod/assign/locallib.php</code></p>
  
  <p>On doing <code>git status</code>, I get:</p>
  
  <pre><code># On branch MDL-38267_24
  # Unmerged paths:
  #   (use "git add/rm &lt;file&gt;..." as appropriate to mark resolution)
  #
  #   both modified:      mod/assign/locallib.php
  #
  </code></pre>
  
  <p>What file should I add in <code>git add ..</code> ?</p>