Copy the file you want to remove in case you just need to remove just something like APIKEY or PASSWORD entry.
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch INSERT_PATH_TO_FILE_HERE" \
--prune-empty --tag-name-filter cat -- --all
Next push changes.
git push origin --force --all
If needed you can restore the backup of the file you just removed and make sure sensitive information is removed before you add it again to remote repo.