Batch undo git modifications
Nov 26, 2020
The following command can be used to find and checkout (undo) all files with modifications:
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).