If this was one of mine, I'd support them in feeling able to follow through an agreed upon processes that I would roleplay out with them to help build confidence and reassure them that I will support them even if they get a sad face or otherwise in trouble if they use it appropriately with someone being physical with them or defending someone else. I agree with getting in touch with the head and arranging with a meeting for the teacher ASAP however you can and if possible - I know not all jobs and financial situations are good for this - taking a half day or two to try to get it sorted, but building up confidence in herself and her boundaries would be important to me as well.
What process is up to you - there are many options floating around on this. The 3 rule is common. I use it and I find it easy to roleplay with kids: 1st ask them to stop politely/firmly/loudly once and leave if possible, 2nd tell them to stop with a warning that if they continue you will defend yourself and leave if possible, 3rd Defense until they stop or an adult gets involved and removes them. This defense is usually physical though moving hands away and pinning hands down or together while repeating that they need to stop doing X I find works well with kids and better than hitting.
Alongside cuddly toys and distractions that others have mentioned that adults can use which would be very difficult for another child to do, I actually have found the above particularly helpful with my own children both in giving them very clear steps and expectations and for when they get dangerously physical with me, others, or themselves. People can think what they want of my parenting but being a disabled woman and having a couple sensory seeking kids, one who went from stroking habit to a habit of hitting me, his father, himself, & his siblings, the 3 rule was one of the major parts of us working through that.
I would fully support a child of mine doing that when faced with a kid who won't stop touching them. It's not about hate - it's about feelings like we're worth defending too. It's far better to have that boundary and sense of self-worth than what happened when I was growing up and just being told to 'be the example' and 'be understanding' which worked until I was about 8, saw once again adults staring on doing nothing, & I snapped. I went absolutely apeshit as I had no way to leave or adults coming or any other way I knew to deal with that so just went into fight mode. I spent years after feeling like it didn't matter at all what I did at school, adults weren't going to support me anyways & that I must be some form of sub-human trash since they all talked about being caring for other people which never seemed to apply to me or some of the others with quiet, ignorable issues. We can sympathetic and recognize both and give them tools.