For example, if I want to change a branch
git checkout testing
error: Your local changes to the following files would be overwritten by checkout:
It seems that the file was being tracked before so you need to explicitly remove it once, by this command:
git rm --cached <file>
This is related to this topic: How to make Git "forget" about a file that was tracked but is now in .gitignore?