Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Git Tip: Reset unstaged changes and files
# Revert changes to modified files.
git reset --hard
# Remove all untracked files and directories. (`-f` is `force`, `-d` is `remove directories`)
git clean -fd

This comment has been minimized.

Copy link

@surendra1987 surendra1987 commented May 14, 2018

git clean -df

This one worked for me. This removes all unstaged changes in one go.

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