title: Git: Undo local changes; git add . + git rm?
body: <p>Need help figuring out a couple common workflows with Github. I come from a VS TFS background, so forgive me.</p>
  
  <p><strong>Undoing Pending Changes</strong></p>
  
  <p>Let's say I have cloned of a git repository to my local file system. At this point, the project's local files match exactly what's in the remote repoistory.</p>
  
  <p>Then I decided to make some changes to the code, and change the local versions of a couple files. After doing some testing, I figure out that I want to discard my local changes and revert the local files back to what they are in the remote repoistory. </p>
  
  <p>How do I undo these local changes, restoring them to the current versions in the repository?</p>
  
  <p><strong>Committing all Changes</strong></p>
  
  <p>Whenever I modify the contents of local files in my repository clone, or add new files, and want to push the changes, I issue "git add .", "git commit" with my comments, then "git push" to my master.</p>
  
  <p>However, when I delete a file locally that's tracked in the repository, "git add ." doesn't capture the rm changes. Instead, I have to "git rm [filename]" before I "git commit" to update the repository. I always forget to do this though.</p>
  
  <p>Is there a git command that will "git add ." and "git rm" any files I've deleted locally, in one step? After modifying local files and deleting a couple, I'd like to issue just one command that captures all my changes before I "git commit".</p>