If you need to defend yourself, for f**ks sake defend yourself. Gender is irrelevant. Just be sure you use an appropriate amount of force. For example, whatever is reasonable and necessary given the circumstances. In this case you might not want to punch her back. You could take a more reasonable approach and bear hug the attacker so they can’t swing at you anymore. Purhaps you could squeeze them until they stop breathing and die. It’s completely up to you. Choose your own adventure.