I want to remove several files from git repository. My repository has several branches and I do following:
git rm --cached filename
git commit -am "deleted filename"
git checkout anotherbranch
I am getting:
error: The following untracked working tree files would be overwritten
by checkout:
output/filename
Please move or remove them before you can switch branches.
Aborting
So question is how to remove the file (accidentally added) from repo? I do NOT want to track the filename by git I plan to add this filename to .gitignore.
Best regards,
Peter