title: Why do changes on a new branch get carried over after switching to a different branch?
body: <p>I faced this problem working on my fork of a repository. When I would make changes to some file(s) on a new branch and then switch to a different branch, git will not raise the error: <code>You have local changes to "X"; cannot switch branches.</code> error. Instead, it will just move to the new branch and reflect the changes in that branch as well. Please let me know if this a beginner mistake on my part.</p>
  
  <p>Steps to reproduce -</p>
  
  <ul>
  <li>Fork the repository</li>
  <li>git checkout -b new-branch-name</li>
  <li>Make changes to any file</li>
  <li>Switch back to master and those changes would reflect there</li>
  </ul>
  
  <p>This is causing my master to be the same as a branch that I made changes to, which continued to stay after. Committing once to the newly created branch, however, fixes this issue. </p>