git Can't switch branch because of changes I can't commit

I have a git repository that's public on github.

There, I have a local file I don't want to share to the public, while other team members want it to be public, so I did git update-index --assume-unchanged (that file).

Now, I want to switch to a different branch. It tells me that there are changes on that file I have to commit or reset. When I try to commit, it says that there are no changes to commit. When I reset (with git reset --hard), it doesn't do anything.

What can I do?


Instead You can stash your change and make changes later as you wish like change branches etc once when you need that stashed changes back you can unstash your change back

check the link Stash the change perfectly expliang how to stash and unstash changes