I believe you can do it most simply with:
git checkout -p <optional filename(s)>
From the manpage:
−p, −−patch Interactively select hunks in the difference between the <tree−ish> (or the index, if unspecified) and the working tree. The chosen hunks are then applied in reverse to the working tree (and if a <tree−ish> was specified, the index).
This means that you can use git checkout −p to selectively discard
edits from your current working tree.