Remain calm. Stay lucid, aware and cautious. ‘Wits’ of course refers to intelligence and awareness. (Compare to Keep your shirt on or Man-up.)
“I took my three nephews to the carnival yesterday and it was pure madness watching over them, I had to keep my wits about me the whole time.