You really don't need to try to prevent it, you only need to prepare, having backups basically, so you can get up and running fairly quickly somewhere else just in case it comes to that. It doesn't even have to be a Github-like service, could just be any server. For example, Linux doesn't even use Github, they use https://git.kernel.org and mailing lists. Nowadays there's a Linux repo on Github, but that's just a read-only mirror.
Git is already decentralized but it sure doesn't hurt to have mirroring servers already up and running, but there has to be some more effort backing up all the Github Issues and Pull Requests, because they are not in the repo and it would be very annoying for developers losing all those.