Awww hon, first of all I am telling you DON'T FEEL BAD!!!! I for one have done the exact same thing (and felt terrible for it!) but honestly, DO NOT beat yourself up about it.
I think there are 2 "triggers" that sometimes means that an involunatary smack happeds, even when you are the most gentle parent.........tiredness on your part, or when they inflict pain on you and it is a shock.....I think it is instinctive to react like that, as much as we don't want to.
When I was pregnant with Charlie, Olivia started hitting occasionally, and once caught me on the lip and it was such a shock of pain that I ended up smacking her......like you, I felt DREADFUL, and bawled my eyes out.
But the only way I know how to not react like that (which is hard if you are in pain or very tired) is to simply hold their hands tighly and talk through it......the calm talking seems to have more effect on a stressed Mummy than a toddler, but at least it diffuses the situation!
But most importantly, don't feel bad, just move on. But I truely know how you are feeling......
Bookmarks