I think it's not so much a matter of keeping unwanted thoughts at bay - there's not much you can do to stop them from occurring, especially in times of stress when there is an effect on the body.
Mostly, I recognize that the thoughts are not an accurate and complete representation of my desires and notice them, but mostly ignore them. Like, I acknowledge that the thought is there, but don't give much weight to it.