This is an old revision of the document!
completely remove a file from all revisions
You find a file that should never have been committed into the repo. Adding the file to a .gitignore list doesn't get rid of it for you, and you want the file to disappear from everything. (probably a good idea to back up repo before doing this)
method 1
git filter-branch --index-filter 'git rm --cached <file>' HEAD
method 2
git filter-branch -f --index-filter 'git update-index --remove filename' HEAD