Happens all the time to me. The way I "deal" with it is by flinching violently, sometimes several times in succession if the thought is still lingering. Sometimes it's accompanied by a semi-loud grunt.
I say "deal" in quotation marks because this method is one borne out of desperation. It's not something I'm content with. Several times I've done this flinching completely involuntarily, surprising myself when it happens. Sometimes I've even done it, also involuntarily but more rarely, when the intrusive thought has already passed. So it's a problem in and of itself.