Skip to content

Instantly share code, notes, and snippets.

@blackymetal
Created June 27, 2013 14:45
Show Gist options
  • Save blackymetal/5877016 to your computer and use it in GitHub Desktop.
Save blackymetal/5877016 to your computer and use it in GitHub Desktop.
Git Discard file changes
git checkout v1.2.3 -- filename # tag v1.2.3
git checkout stable -- filename # stable branch
git checkout origin/master -- filename # upstream master
git checkout HEAD -- filename # the version from the most recent commit
git checkout HEAD^ -- filename # the version before the most recent commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment