You should read this article from Github:
But, the most important part of the article is certainly this quote:
Danger: Once the commit has been pushed you should consider the data to be compromised. If you committed a password, change it! If you committed a key, generate a new one.