Purge all files from every directory that has a specified prefix.

Run this command, replacing resized with your target directory prefix.

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch *\*\resized**\*' --prune-empty --tag-name-filter cat -- --all

This will remove all files that are in any directory that starts with resized , such as resized80x100 . Follow up with:

git push origin --force --all

and

git push origin --force --tag if you have tags.

The key for me was the *\*\resized**\* to match all files in any directory that starts with resized .

See also: https://help.github.com/articles/remove-sensitive-data/