title: git checkout < branch > failure for local changes
body: <p>I am new to Git. It seems to be a fantastic non-liner workflow based on the Directed Acyclic Graph.</p>
  
  <p>According to the <a href="https://git-scm.com/docs/git-checkout" rel="nofollow">git checkout doc</a>:</p>
  
  <blockquote>
    <p><strong><em>git checkout <code>&lt;branch&gt;</code></em></strong></p>
    
    <p>To prepare for working on , switch to it by updating the index
    and the files in the working tree, and by pointing HEAD at the branch.
    <strong>Local modifications to the files in the working tree are kept, so that
    they can be committed to the <em><code>&lt;branch&gt;</code></em>.</strong></p>
  </blockquote>
  
  <p>I have 2 branches:</p>
  
  <ul>
  <li>master</li>
  <li>dev</li>
  </ul>
  
  <p>Both branches are clean and up-to-date.</p>
  
  <p>I did this:</p>
  
  <pre><code>git checkout dev
  &lt;change a tracked file&gt;
  git checkout master
  </code></pre>
  
  <p>Then I got this error:</p>
  
  <blockquote>
    <p>error: Your local changes to the following files would be overwritten
    by checkout:
            readme.txt Please, commit your changes or stash them before you can switch branches. Aborting</p>
  </blockquote>
  
  <p>So does this conflict with the bold part of the doc?</p>
  
  <h2>ADD</h2>
  
  <p>Thanks for all the comments and replies. I can understand Git's good intention to avoid data loss. I just want to point out a potential doc ambiguity/error.</p>