Well, depends less on if it's a guy or a girl and more on how hard I got punched. If it was really, really hard (as in "I will smash your face next!"-hard), I'd back a few steps up and get ready to fight or run, while I ask why the fuck he/she punched me. Should he/she raise his/her arm again, I would hit them.
If it's less then that, I would just ask "Why the hell did you hit me?".
I don't really care if it's a man or a woman.
Actually, I was known as "Mädchenschläger" (girl-beater), for a while in school - a girl I had known for a few years just walked up to me and started to hit me in the face, as hard as she could. I was so suprised that I got hit again, but after that, I gave her a bit of her own medicine until she stopped (no, she was not badly hurt, no, I didn't aim for her head). Turns out she didn't like my opinion of her boyfriend. What a wonderful motivation to just straight-up attack someone without warning.
Point is, man and women have to be treated equally - either NEVER punch back, or punch back REGARDLESS of the gender of the attacker.