title: I wanted to give up on recent changes and go back to the latest commit that had been pushed. Unstaged deleted:
body: <p>I want to give up on recent changes and go back to the latest commit that had been pushed (2de1222).</p>
  
  <p>Only one file was being worked on (unstaged) at that time. One local commit had been made since 2de1222. I made a gitk in a separate window so I could verify the SHAs of each commit and what the included files should look like.</p>
  
  <p>First I tried <code>git reset 2de1222 --hard</code>. That gave me the message "fatal: This operation must be run in a work tree". So I did a 'git status' and it showed my one modified file but under "Changes not staged for commit" there was a long list of files which are all part of my app. A 'gitk' here shows that I am at the commit that I wanted to move to. The target file in the working directory looks as it should for commit 2de1222.</p>
  
  <p>I searched for answers about similar messages and tried the following suggestions:</p>
  
  <pre><code>git checkout master
  
  git reset --soft HEAD@{1}
  
  git reset HEAD [my_filename]
  
  git pull origin master
  
  git reset --hard 2de1222  (different argument order)
  </code></pre>
  
  <p>In each case I got the same results from 'git status', along with that same warning: "fatal: This operation must be run in a work tree".
  I don't really understand why git lists a bunch of supposed deletions and why I'm not in a "work tree". </p>
  
  <p>How can I get back to the same state I was in immediately after the 2de1222 commit (where 'git status' shows no files) and be ready to change, test and commit the one file I need to? (hopefully without having to address each "deleted" file separately)?</p>