how to check git changes before commit

C++
git diff --staged
git diff [filename]

Source

Also in C++: