One of the 100 questions in this topic
The git reset --hard HEAD command discards all changes and returns to the latest commit.