disregard incoming git pull and return to last commit

C++
git reset --hard HEAD
Source

Also in C++: