So if your herpes is anal - he would have to have put his mouth there to get a cold sore.
This is incorrect. Yes, herpes is largely localised, and most people who get reoccurances have them appear in the same place each time. However, this is not always the case. The host can spread it to other areas around the usual localised area - usually by scratching or by touching the affected area and then touching another area close by.
A lot of people with herpes are fully or mostly asymptomatic. This means the virus can be present on the skin with no signs/symptoms.
It is possible that the OP had the virus present on her genitals (without symptoms) and she unknowingly transferred it to her anus/bum herself.
@Littlebeachhut I’ve had genital Herpes once
This is also incorrect. No one has herpes once. You may have had an outbreak once and no further occurrences, but that does not mean you no longer have herpes or you stop having herpes whilst you aren't displaying symptoms. Once you contract herpes, you will always have herpes.
The fact you haven't shown any further symptoms since you initial outbreak means your immune system does a good job of suppressing the virus to prevent reoccurances. However, there is a small percent of time (around 2 or 3 days a year) when the virus will still be present on your genitals without there being any symptoms - it is called "viral shedding" and it is possible to transmit the virus to others during this time.
Although the timing suggests your partner has recently contracted herpes from you, this may not be the case.
Your partner may have contracted herpes a long time ago from a previous partner/relative (babies/young children often contract it from family members kissing them). He may have never had an outbreak until now. Or he might have previously had outbreaks but not realised it was herpes (he may have thought he had a spot). Outbreaks are usually triggered by stress, sunlight, poor lifestyle.
I'm not sure how you can just forget you have herpes, and forget to mention it to a new sexual partner. Perhaps you just decided not to tell him because you were afraid of how he would react. It's not an easy conversation to have with any new partner, but it is the responsible thing to do. You need to be honest with him now. Tell him the truth. It might be too late and he might walk away as he will likely feel angry, betrayed or lied to. Either way, do the right thing.