As a follow-up to my previous posts linked below, let me show you how to remove unstaged changes in Git. Although it’s much easier and arguably faster to do everything from an IDE GUI like VS Code for instance, the focus here is from the CLI only.
Remove unstaged changes to a single file
git checkout -- <filename>
Remove unstaged changes for the entire working tree directory
git checkout -- .