Skip to content

Instantly share code, notes, and snippets.

@miss-invincible
Created April 23, 2017 17:59
Show Gist options
  • Save miss-invincible/eff7963b90c85c28baaddc5c721f9df8 to your computer and use it in GitHub Desktop.
Save miss-invincible/eff7963b90c85c28baaddc5c721f9df8 to your computer and use it in GitHub Desktop.
revert changes of a single file in git

if you wish to revert the changes of a single file use this command (when you file name does not match with any of the branch names):
git checkout filename

if your file name is similar to any of your branch names the use this command:
git checkout -- filename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment