When you get the Git
checkout error, “Your local changes to the following files would be overwritten by checkout,” one likely cause is that files in the master branch are indeed newer than the files in your feature branch.
But another possibility that I just learned about is that you did a
git add, but forgot to do a
git commit before trying to switch branches. My current wrong/accidental workflow looks like this: