I was working on a branch in my git repo and just messed it up and wanted to just get rid of the changes.
So, I didn’t commit the changes and checked out my master branch and then did git branch -D "branch_to_remove".
However, the files are still in my directory and the changes are still staged for commit on my master branch.
How can i get rid of all those changes?
You can reset your working directory to the master with:
To delete the untracked files, I usually use (modified following @Mark Longair’s comments):
Edit
Or use
git clean -das Noufal suggested in the comments in another answer (now deleted).