check changes made to file before commit code example Example: how to check git changes before commit git diff --staged