Some time ago I added info(files) that must be private. Removing from the project is not problem, but I also need to remove it from git
history.
I use Gi
remove the file and rewrite history from the commit you done with the removed file(this will create new commit hash from the file you commited):
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' --prune-empty --tag-name-filter cat -- --all
now force push the repo:
git push origin --force --all
now tell your collaborators to rebase
.