Solutions for backing-up my codebase

I have a codebase that I’ve been keeping on Github that I don’t want to worry about losing. I’ve intermittently backed up all the repos to an S3 instance, but this doesn’t feel secure. If my Github and AWS accounts, or just my machine, were compromised then our entire codebase & its backups could be deleted.

What can I do to protect against this? I’m having a difficult time finding solutions which guarantee that I won’t have to worry about an account being compromised and everything being subsequently deleted.