Link: https://help.github.com/articles/remove-sensitive-data
git log --all --pretty=format: --name-only | sort -u | uniq
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch <filename>' --prune-empty --tag-name-filter cat -- --all
rm -rf .git/refs/original/
maybe replaced by
git for-each-ref --format="%(refname)" .git/refs/original/ | xargs -n 1 git update-ref -d
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
git push origin master --force
<note>If this step fails, you've to set denyNonFastforwards = false.</note>