title: quick way to checkout (revert workspace changes) for most but not all files?
body: <p>tl;dr: <strong>what will happen if I stage a file and then run <code>git checkout .</code>?</strong></p>
  
  <p>Here's the situation. I have an existing directory that I want to "merge" with the contents of a git repo (and integrate it with the repo). </p>
  
  <p>I will do this by copying over the <code>.git</code> directory, this moves the repo but not the files, so i can do a sane manual "merge".</p>
  
  <p>The <code>git status</code> will show a large number of "deleted" files. I want to <code>git checkout</code> these deleted files in a quick way but I also want to exclude a few of the "modified" files to keep their current filesystem contents. </p>
  
  <p>So... I can run <code>git checkout</code> on all the ones I want to copy over, but is there a quicker way? </p>
  
  <p>Maybe...</p>
  
  <ol>
  <li>stage (<code>git add</code>) the modified files I wanna keep, then run <code>git checkout .</code></li>
  <li>use the original place that I cloned to (where i copied the <code>.git/</code> dir out of and use the file explorer to copy over the files to replace (still requires picking them out though)</li>
  </ol>
  
  <p>So i guess the question boils down to "does git checkout affect staged files"?</p>
  
  <hr>
  
  <p>The rest of the question is just a hugely extraneous background situational explanation. </p>
  
  <p>So I'm on a windows machine and I want to integrate my Sublime Text 3 User package git repo which was set up from OS X.</p>
  
  <p>So I go checkout my sublime-text-3-user-package repo from github: </p>
  
  <p>(MSYS bash shell) </p>
  
  <pre><code>cd ~
  git clone https://github.com/my-st3-user-package
  cp -r my-st3-user-package/.git ~/AppData/Roaming/Sublime\ Text\ 3/Packages/User
  </code></pre>
  
  <p>Now in my User dir I can see all the missing files and I gotta reconcile them. </p>
  
  <p>I do so for <code>Preferences.sublime-settings</code>, and it looks like this now.</p>
  
  <pre><code>$ git status
  # On branch master
  # Changes not staged for commit:
  #   (use "git add/rm &lt;file&gt;..." to update what will be committed)
  #   (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
  #
  #       deleted:    .gitignore
  #       deleted:    Default (OSX).sublime-keymap
  #       deleted:    GitGutter.sublime-settings
  #       deleted:    Gitconfig.JSON-tmLanguage
  #       deleted:    Gitconfig.tmLanguage
  #       modified:   Package Control.sublime-settings
  #       deleted:    README.md
  #       deleted:    Shell-Unix-Generic.sublime-settings
  #       deleted:    SublimeLinter.sublime-settings
  #       deleted:    Tomorrow-Night-Eighties.tmTheme
  #       deleted:    movemultiplelines.py
  #
  # Untracked files:
  #   (use "git add &lt;file&gt;..." to include in what will be committed)
  #
  #       Package Control.ca-bundle
  #       Package Control.ca-list
  #       Package Control.cache/
  #       Package Control.last-run
  no changes added to commit (use "git add" and/or "git commit -a")
  </code></pre>
  
  <p>I want to bring back all of these files except for <code>Package Control.sublime-settings</code>. </p>