Git undo modifications

Much like you can get a list of deleted files, you can also get a list of modifications and then check them all out (undo) in one command using the following:

git checkout $(git ls-files -m)

This is effectively an “undo” of all modifications in the given branch (but it doesn’t impact added or deleted files).