Okay, so I figured it out, since I didn't find a suitable answer on the web myself and in case anyone else needs it... Might not be the best way, but at least gave the desired result.
I ran two commands. This one on the private key file:
openssl rsa -noout -modulus -in key.pem
The following on the certificate:
openssl req -noout -modulus -in cert.csr
If the outputs matched, the key and certificate matched.
Found the correct private key and was able to restore the correct one from the repository.