how to see changes in git 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.
Example 3: git show diff in modified file
git diff [filename]