git reflog reset

C++
git reset HEAD@{1}git reflog //to get commitID
git reset #commitID
Source

Also in C++: