If you accidentally committed something you shouldn’t have, and pushed it to Github, there are still ways to delete or modify it.
You can do an interactive rebase, which is useful if the commit isn’t the most recent one. If the commit was, for example, 12 commits ago, you can rebase from then, remove the offending commit, and save.
git rebase -i HEAD~12