title: Merging a modified file from one branch, to another branch with additional commits Git
body: <p>I am trying to merge some changes made to a particular file (GitBasics.docx shown by change 2), to another branch.</p>
  
  <p>Below are the three recent commits from branch <code>develop</code> (contains the file to which I made changes):</p>
  
  <pre><code>commit c5fab21e2837808fbc1a4d351b9d605ae856477e
  Author: &lt;&gt;
  Date:   Tue Jul 10 17:25:40 2018 +0530
  
      change 3
  
  commit 872926a8a356183e46d281a14578f3895438ae72
  Author: &lt;&gt;
  Date:   Mon Jul 9 12:58:33 2018 +0530
  
      change 2 (made to Git Basics.docx)
  
  commit 25ce9bcf0b2c44e29e148d11ea89df508758d014
  Author: &lt;&gt;
  Date:   Thu Jul 5 20:22:21 2018 +0530
  
      change 1
  </code></pre>
  
  <p>And below are the two recent commits from branch <code>test</code> (to which I've made additional changes):</p>
  
  <pre><code>commit c9f0ef332e1f5e9f398179372222d2ac5580ee96
  Author: &lt;&gt;
  Date:   Fri Jul 6 19:41:55 2018 +0530
  
      change 4
  
  commit 25ce9bcf0b2c44e29e148d11ea89df508758d014
  Author: &lt;&gt;
  Date:   Thu Jul 5 20:22:21 2018 +0530
  
      change 1
  </code></pre>
  
  <p>As you can probably see, change 1 is where I created branch <code>test</code>. I would like to merge change 2 from <code>develop</code> to <code>test</code>. I won't be able to use <code>git merge</code> because <code>develop</code> also has additional commits (change 4) different from <code>test</code> and I do not want them merged.</p>
  
  <p>By doing some research I came across the command <code>git checkout source_branch &lt;paths&gt;</code> which serves my purpose currently but I also learned that this method is simply replacing the file in the new branch, instead of merging. Hence if changes (to the same file) were made on both branches, I would lose them on the branch the file was being copied to.</p>
  
  <p>The other option I believe is <code>git cherry-pick</code> but frankly I am unable to understand how to use this command from the information given online. How can I use this command, or are there any other ways to achieve what I am trying to accomplish?</p>
  
  <p><strong>I was referring to <a href="http://schacon.github.io/git/git-cherry-pick.html" rel="nofollow noreferrer">http://schacon.github.io/git/git-cherry-pick.html</a> for info on <code>git cherry-pick</code>, I didn't think the provided solution would be so simple. I am sharing the link in case it helps anybody else.</strong></p>