Skip to content

Instantly share code, notes, and snippets.

@reinislejnieks
Last active October 2, 2018 08:39
Show Gist options
  • Save reinislejnieks/02341ca05f73c79b6c3d81eb6bc2a844 to your computer and use it in GitHub Desktop.
Save reinislejnieks/02341ca05f73c79b6c3d81eb6bc2a844 to your computer and use it in GitHub Desktop.
#git usefull

Remove unstaged changes in all tracked files.

git checkout -- .

Remove unstaged changes in one file.

git checkout -- [filepath]

If file is staged but no commited remove it with:

git reset HEAD [filepath]

To clean untracked files. Check what will be deleted:

git clean -n

Then to apply changes:

git clean -f

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