You're able to revoke your own access, as long as there are still other admins present for that repository. Otherwise anyone could just add you as an admin to any repository, and you could never get rid of it.
Once you remove your access, you cannot restore it. If you are the administrator of the team that this repo belongs to, you should be able to access this repository's admin and give yourself access again. If you were only attached to this one repository, you'll need to get the owner to re-add you.