git checkout reset hard

C#
git checkout reset HEAD~1
Source

Also in C#: