how to get my last commit in git code example Example 1: git get current commit git rev-parse HEAD Example 2: how do i get the last commit $ git reset --soft HEAD~1