How can I forgive myself?

When I was 22/23 I was alone abroad to study... I had no friends so I was very lonely and thus met up with a girl one day...We had sex...i regretted it right afterwards because i did not even consider this person attractive by any means... I did wear a condom, nevertheless I am pretty sure I got infected with Cytomegalovirus (a herpesvirus) that day by her. I think I had sex with her because I was so lonely and generally at a low point in my life....

Is my behaviour understandable(meeting and having sex with her) or completely stupid because I keep beating myself up for having sex with her and getting this virus...

How Can I forgive myself? Should I Even forgive myself for this stupidity.... I hate myself right now/no confidence at all... And does really EVERYBODY make (such) mistakes?