So you know what you want your dog "not" to do, what do you want her to do though? If it is sit nicely for petting, then you need to tell her what she should do. As she approaches you for petting make sure you are cueing her to "sit" (I assume she knows the "sit" cue). If left to their own devices, dogs don't always make the choice we want them to, so set her up for success by actually cueing the behavior you do want her to do so she knows what's expected of her. Then if she doesn't do it, you can fairly deliver a consequence for inappropriate behavior.
Kilby'sMum's technique is likely to be the most effective at teaching the dog what not to do. For one thing, by standing up and diverting human attention, she is delivering a meaningful consequence to the unwanted behavior. Because she is not pushing, touching, or speaking to the dog, she is not inadvertantly providing the "reward" of continued interaction. Additionally, because she stands at the first sign of inappropriate behavior (paw on leg) she is delivering the consequence in a consistent and timely manner which allows her dog to learn what specific behavior earned her the "punishment".
If you want to make this technique more effective, you could pair it with a consistently used punisher word like "Eh-eh" or "Enough" that you would say right before you stand up. With repetition, this word would come to predict the punishment and the dog would alter its behavior upon hearing just the word.
Of course, you also need to teach the dog what to do, so go back and spend some time retraining the sit. Make sure that you include distraction training as well. For this dog, a big distraction is physical touching and verbal praise, so work each of those distractions at low levels, gradually increasing to the point that the dog can hold its stay while you pet them or while you praise them. Once they can sit for the individual distractions, then you can work on combining them at low levels, again gradually building up to where you are petting and praising with enthusiasm and the dog is still capable of maintaining the sit. Then work on callling the dog to you, cueing a sit, and then delivering the petting and praise--you may have to back track to lower levels of enthusiasm. Then do the exercise from a seated position.
Additionally, it would be of benefit to teach this dog to yield to your space. This can very effectively be done by teaching the dog a "back" cue. With the dog in front of you, step toward them. When they take a step back (watch for movement from their back feet) mark it with a clicker or verbal marker of "yes" and toss a treat behind them. They will go for the tossed treat and then likely come back toward you for more. This sets them up in just the right position to step into them again. As they are reliably taking that step back in response to your step in, you can add the verbal cue "back". Gradually you can take more steps into them and require that they back up more. Always toss or deliver the treat back and away from you so as not to create any incentive for them to come closer into your space. Next you can start fading your stepping-in motion and the dog will learn to back away from you on verbal cue alone. Then you can introduce the cue from a seated position.
Eventually you'll be able to call the dog to you, cue a "sit" (or because of repitition the dog might auto sit) and praise and pet your dog. If the dog should get pushy, you will be able to say "Enough" to stop the mis-behavior and then cue a "back" to get the dog to give you more space. Recue the "sit" and begin praising and petting again.