gather (or collect) your wits bring yourself back to a state of equanimity.
1984Geraldine McCaughreanThe Canterbury Tales Poor old man, he was too astonished to speak. And before he could collect his wits, he was sitting at table…with his lord on one side and his daughter on the other.