Git: How to discard local changes?
To discard all local changes that are not committed in Git, you can use `git reset --hard HEAD` command. This will discard all local changes to the state of the HEAD. If you only want to discard changes to a specific file use `git checkout -- [file]`. Remember though, using these commands will permanently discard your local changes. If you're unsure and want to check which files have changed first, run `git status`. Always make sure you really want to discard changes as this process is not reversible. Take precautions and consider using `git stash` which puts the changes in a separate place, where they can be re-applied or completely discarded later.