title: Unable to discard all local files in git
body: <p>I have 2 files that are in my working directory. I want to completely discard these files so I can switch branches. </p>
  
  <p>There are many helpful guides online, and I have tried every answer I can find to remove these files, yet they still persist. </p>
  
  <pre><code>user@machine:~/Code/foo$ git status
  Changes not staged for commit:
    (use "git add &lt;file&gt;..." to update what will be committed)
    (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
  
      modified:   src/test/foo.c
      modified:   src/test/bar.c
  </code></pre>
  
  <p>Commands I have tried based on other stackoverflow questions. </p>
  
  <pre><code> git reset 
  
   git reset --hard HEAD^
  
   git stash save --keep-index
   git stash drop
  
   git checkout HEAD -- $(git ls-files -m)
  
   git clean -f
   git clean -dfx
  
   git checkout -- .
  
   git checkout -- *
  
   git checkout 123456
  
   git reset --hard 123456
  
   git reset HEAD --hard
  </code></pre>
  
  <p>Amazingly, after every command, I find the files are still present! </p>
  
  <pre><code>user@machine:~/Code/foo$ git status
  Changes not staged for commit:
    (use "git add &lt;file&gt;..." to update what will be committed)
    (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
  
      modified:   src/test/foo.c
      modified:   src/test/bar.c
  </code></pre>
  
  <p>Since there are only 2 files, I know I <em>could</em> just recheck them out one by one. However if this happened again and I had 100 files, I want to know the procedure to blow all of them away in one sweep. </p>
  
  <pre><code> git checkout src/test/foo.c
   git checkout src/test/bar.c
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Aparently not even a git checkout works</p>
  
  <pre><code>git checkout src/test/foo.c
  echo $?
  0
  git checkout src/test/bar.c
  echo $?
  0
  
  user@machine:~/Code/foo$ git status
  Changes not staged for commit:
    (use "git add &lt;file&gt;..." to update what will be committed)
    (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
  
      modified:   src/test/foo.c
      modified:   src/test/bar.c
  </code></pre>
  
  <p>These files just wont go away. </p>
  
  <p><strong>Update2</strong></p>
  
  <p>I've tried these command as well with no luck. </p>
  
  <pre><code>git reflog
  git checkout HEAD@{17}
  
  git init
  git reset --hard HEAD^
  </code></pre>
  
  <p><strong>Update3</strong></p>
  
  <p>Stashing does nothing. </p>
  
  <pre><code>git checkout master
  git stash
  git stash pop
  git stash drop
  </code></pre>
  
  <p>Deleting the files does not work either. </p>
  
  <pre><code>user@machine:~/Code/foo$ git rm --cached $(git ls-files -m)
  rm 'src/test/foo.c'
  rm 'src/test/bar.c'
  
  user@machine:~/Code/foo$ git status
  On branch master
  Your branch is behind 'origin/master' by 162 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
  
  Changes to be committed:
  (use "git reset HEAD &lt;file&gt;..." to unstage)
  
      deleted:   src/test/foo.c
      deleted:   src/test/bar.c
  </code></pre>