Skip to content

Instantly share code, notes, and snippets.

@vitalyp
Last active June 6, 2016 14:07
Show Gist options
  • Save vitalyp/65356900924312775a4ab91992140dac to your computer and use it in GitHub Desktop.
Save vitalyp/65356900924312775a4ab91992140dac to your computer and use it in GitHub Desktop.

If you want to revert changes made to your working copy, do this:

git checkout .

If you want to revert changes made to the index (i.e., that you have added), do this. Warning this will reset all of your unpushed commits to master!:

git reset

If you want to revert a change that you have committed, do this:

git revert ...

If you want to remove untracked files (e.g., new files, generated files):

git clean -f 

Or untracked directories:

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