I try to remove unnecessary files from git repository. That files were initially added and now they are in several branches. What I want is simply stop tracking changes in that files, I don't care what changes should stay there, but I need that files to stay on file system.
I tried following
git filter-branch --index-filter "git rm --cached --ignore-unmatch file_to_remove" HEAD
but that removed file from file system what is unwanted.