title: Why are changes in one branch visible in another branch?
body: <p>I execute the following sequence of commands:</p>
  
  <pre><code>git init rep
  cd rep/
  echo '111' &gt; 1.txt
  git add 1.txt 
  git commit -m '1'
  git checkout -b dev
  echo '222' &gt; 1.txt 
  git checkout master
  more 1.txt 
  </code></pre>
  
  <p>As a result of these commands I see</p>
  
  <pre><code>222
  </code></pre>
  
  <p>And I do not understand why. As you can see I create and go into the 'dev' branch. I do some changes there but I do not add and do not commit them. Why after going back from 'dev' to 'master' I do see the changes that I did in 'dev'? Shouldn't they stay in dev until I add, commit and merge them back to master?</p>