http://progit.org/book/ch6-4.html
http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html
From the Pro Git book:
The Nuclear Option: filter-branch