gitでcommitしてしまったファイルを亡きものしたいときに使うコマンド

「あれどうだったっけ?」ってなるのでメモしておきます。

$  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

Reference sites