title: How do you switch between branches in Visual Studio Code with Git?
body: <p>I am trying to workout how branching works in Visual Studio Code and Git. Previously I've worked with <a href="https://en.wikipedia.org/wiki/Team_Foundation_Server" rel="nofollow noreferrer">TFS</a> which was pretty simple - you create a branch and this is all stored in a separate folder on your disk so you can easily work on one branch or another.</p>
  <p>So in Visual Studio Code I have created a new branch &quot;test&quot; from master. In Visual Studio Code I am looking at the branch icon bottom left to see which branch I'm working in.</p>
  <p><a href="https://i.stack.imgur.com/Q5dH1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q5dH1.png" alt="enter image description here" /></a></p>
  <p>It says I'm working in test, so I make changes to file1, commit and synchronise the changes. I now want to work on the master branch, so I go bottom left, switch to master, <em>but my changes from the test branch are still displayed in the editor.</em></p>
  <p>If I look on the hard disk, my changes from the test branch are there, and there is no separate test &amp; master folder. So how do I get to work on the master branch again? I've tried checkout, synchronising on the master branch, but I always have the test changes displayed.</p>
  <p>A typical scenario is, I'm part way through working on a new feature on a branch, and I need to switch to master to do a hotfix, before returning to the feature branch. Switching between those branches is escaping me.</p>