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
git recommends to use git-filter-repo (when git filter-branch command is executed). There is a long list of why it is better than any other alternatives (https://github.com/newren/git-filter-repo#why-filter-repo-instead-of-other-alternatives), my experience is that it is very simple and very fast.
This command removes the file from all commits in all branches:
git filter-repo --path
Multiple paths can be specified by using multiple --path parameters. You can find detailed documentation here:
https://www.mankier.com/1/git-filter-repo