How can I discard modified files? April 18, 2023 by Tarik A git reset --hard HEAD should solve the problem.