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

execute the command for every path that the sensitive file had exist, replacing PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA with the path.

Further ReadingPermalink

  1. Removing sensitive data from a repository | GitHub Help

Posted:

Comments are configured with provider: disqus, but are disabled in non-production environments.