git see the changes before commit code example
Example 1: how to check git changes before commit
git diff --staged
Example 2: git how to see changes made by a commit
git show <commit sha1> # Notice that the default option is HEAD.
git diff --staged
git show <commit sha1> # Notice that the default option is HEAD.