Purging a sensitive file from a Git repository

Well it happens to me all the time. While developing, I add a config file with some sensitive data somewhere in my repository, forget to add it to my .gitignore and accidentally commit it. Then, after another 5 commits, I notice my flaw and then have to somehow purge...