My 4 year old hits me

I really need advice on what to do about my 4 year old who hits me. Today my two year old was playing with kids scissors outside, pretending to cut the grass. My 4 year old came up and took his scissors off him. My 2 year old was obviously hysterical so I grabbed the scissors off my 4 year old who also began to cry hysterically. I said no, you can’t snatch. They were both crying and after a point I was like you know what, my 2 year old doesn’t even want to play with it anymore, he’s only crying because he doesn’t want his older brother to have the scissors. I eventually gave in and let the 4 year old have them and I said snatching is not nice, please don’t do that again. He made an angry face and while I was holding my 2 year old to console him, my 4 year old came up and punched me in the thigh. He did this in front of my sisters and mum who were shocked. I was so mad and told him don’t you dare hit me again, if you do I will hit you back. What would have been the correct way to handle this situation?