Git provides a native way to remove a file from the entire commit history
Make sure you backup your repository before attempting this.
Use the git filter-branch command to remove the file from all commits in your repository history.
Replace <file_path> with the actual file path and name from the root of your project:
git filter-branch --force --tree-filter 'rm -f ' --prune-empty -- --all