i want to discard my unstaged changes
Be careful with this. When you discard your changes, they’re gone for good. Anything you want to keep should staged or committed first.
Below, tracked refers to files that you have previously added to git. untracked refers to files that have never been added. Be especially careful when discarding untracked files - because they’ve never been tracked in Git, it will be as if they never existed after you run the command.
To discard just one unstaged file:
git checkout -- <filename>
To discard all unstaged (tracked) files:
git checkout .
To discard all untracked files:
git clean
To discard all untracked files, including those ignored by .gitignore:
git clean -f