link
git/filter-branch

Rewrite History

Rewrite branches to filter out some files or modify commits

git
filter
history

Command

git filter-branch

Examples

Remove file from history

git filter-branch --tree-filter "rm -f secret.txt"