You could remove the secret keys using the git-filter-repo tool, see this explanation in the GitHub documentation.
git-filter-repo is much preferable to the older git filter-branch.
My old, now somewhat out-of-date answer:
You could remove the secret keys from the repository using a hammer like git filter-branch. There is a nice explanation on GitHub’s help pages.