title: Confusion over branch creation in git
body: <p>After making a few changes to branch <code>master</code> I decided to work from a new branch. I did <code>git checkout -b new_branch_name</code> and a new branch was created and checked out. <code>git status</code> showed the changes I had made to <code>master</code>. </p>
  
  <p>I was curious if my changes were now on both branches (<code>master</code> and <code>new_branch_name</code>) or just <code>new_branch_name</code>. So I checked out <code>master</code> and noticed my changes were there as well. So I reverted those changes with <code>git checkout -- fileThatChanged</code>. The changes were indeed gone from <code>master</code>.</p>
  
  <p>Unfortunately checking out <code>new_branch_name</code> and running <code>git status</code> showed my changes were reverted from that branch as well.</p>
  
  <p>I'd like to understand what happened and how can I avoid this in the future.</p>
  
  <p>One solution is to just create/checkout a new branch before starting work.</p>