title: Switch Git branch without files checkout
body: <p>Is it possible in Git to switch to another branch without checking out all files?</p>
  
  <p>After switching branch I need to delete all files, regenerate them, commit and switch back. So checking out files is just a waste of time (and there are about 14,000 files - it is a long operation).</p>
  
  <p>To make everything clear:</p>
  
  <p>I need all this to upload <a href="http://toy.github.com/rb/" rel="noreferrer">documentation</a> to GitHub.</p>
  
  <p>I have a repository with the <em>gh-pages</em> branch. When I rebuild documentation locally, I copy it to the repository directory, commit and push to GitHub. But I was not happy, because I had two copies of documentation locally. And I decided to create an empty branch and after committing, switch to empty and delete files. But switching back is a long operation - so I asked this question.</p>
  
  <p>I know that I can just leave on the <em>gh-pages</em> branch and delete files, but I don't like dirty working trees.</p>