Skip to content

Instantly share code, notes, and snippets.

@riccardoscalco
Created May 6, 2015 07:22
Show Gist options
  • Save riccardoscalco/f6e337d4667598123b9a to your computer and use it in GitHub Desktop.
Save riccardoscalco/f6e337d4667598123b9a to your computer and use it in GitHub Desktop.
Revert changes in a git repository

Discard changes on in working directory (no add, no commit)

$ git checkout -- <file>

Discard changes in working directory (no add, no commit)

$ git checkout -- .

Unstage in unstage after git add >file>

$ git rm --cached <file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment