[git] How can I see what has changed in a file before committing to git?

For me git add -p is the most useful way (and intended I think by git developers?) to review all unstaged changes (it shows the diff for each file), choose a good set of changes that ought to go with a commit, then when you have staged all of those, then use git commit, and repeat for the next commit. Then you can make each commit be a useful or meaningful set of changes even if they took place in various files. I would also suggest creating a new branch for each ticket or similar activity, and switch between them using checkout (perhaps using git stash if you don't want to commit before switching), though if you are doing many quick changes this may be a pain. Don't forget to merge often.