[Git] Find the commit hash for a reference such as HEAD~n

Created on November 30, 2026

Use git show with a commit expression such as HEAD~10. The first line of the default output shows the hash of the commit ten first-parent steps before HEAD.

git show HEAD~10
Git