how to retrieve last commit in git code example Example: how do i get the last commit $ git reset --soft HEAD~1