Scare-out-of-one-s-wits Definition

verb

(idiomatic) To frighten someone to such an extent that they behave irrationally.

He scared me out of my wits, sneaking up behind me in the dark, like that.
Wiktionary