Until yesterday my project has only a branch with a .gitignore file similar to:
*.log
upload/*
!upload/global/empty.txt
It worked fine until I added a new branch and changed this .gitignore to not ignore upload files. The new .gitignore file remained with only one line:
*.log
I returned to master branch without problems, but now each time I want to go to the new branch I receive a message like this:
error: Untracked working tree file 'upload/file.txt' would be overwritten by merge.
I need to checkout this branch to work with it or, at least, rescue the commits I made.
Note: I've found this similar question, but doesn't answer my question.