Hello, and I hope I can help you today.
It is really not possible to impregnate someone with the barrier of your underwear between you, especially if you didn't ejaculate. Sperm die when exposed to air, so even if there was some semen left from your earlier act of intercourse, it would have died on your skin and on your underwear.
Furthermore, it is theoretically possible to impregnate someone without penetration, but again, the sperm must be close to the opening and in a moist area so it can swim in liquid. Withdrawal is not a 100 percent effective method of
contraception, but if there was no penetration, your chances of impregnating someone from ejaculating outside the vagina is also nearly impossible.
So I would not worry in this situation about unplanned
pregnancy, and I think you and your girlfriend need not worry about this type of activity causing pregnancy.
I hope I was able to answer your question and that my advice was reassuring.
Best wishes, Dr. Brown