title: How to checkout files from another branch and then overwrite the current branch
body: <p>Based on <a href="http://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/" rel="nofollow">http://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/</a>, we can use the following command to merge changes from another branch to local branch.</p>
  
  <p>For example:</p>
  
  <pre><code>$git checkout master -- hello.c
  </code></pre>
  
  <p>This command will merge the hello.c from master branch to current local branch.</p>
  
  <p>Question> What if I want to use the hello.c from master to overwrite my local branch file without any merge? which option I should use?</p>
  
  <p>Thank you</p>
  
  <p>-- Update --</p>
  
  <pre><code>$ pwd
  /sandbox/projectOne
  
  $ git branch
    feature/F_Source
  * feature/F_Dest
    master
  $ git status -s
  $
  $ git diff feature/F_Source feature/F_Dest -- Messages/src/Hello.C | wc -l
  165
  $ git checkout feature/F_Source -- Messages/src/Hello.C
  $
  $ git diff feature/F_Source feature/F_Dest -- Messages/src/Hello.C | wc -l
  165
  $ git status -s
  M  Messages/src/Hello.C
  $
  </code></pre>
  
  <p>As you can see, before the checkout, there is a difference between F_Source Hello.C and F_Dest Hello.C. After the checkout, there is still a difference. So I assume the checkout is NOT a overwrite operation otherwise we should not see any difference.</p>