Skip to content

Instantly share code, notes, and snippets.

@yzgyyang
Last active June 12, 2017 13:55
Show Gist options
  • Save yzgyyang/4eb993048a4022363233ec762352a413 to your computer and use it in GitHub Desktop.
Save yzgyyang/4eb993048a4022363233ec762352a413 to your computer and use it in GitHub Desktop.
Git discard unstaged changes

To remove all untracked files:

git clean -df

For a specific file use:

git checkout path/to/file/to/revert

For all unstaged files use:

git checkout -- .

Make sure to include the period at the end.

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