To return to a calm, sensible, or normal state of mind after being confused, distressed, or lost in thought.
"She sat quietly for a few minutes and gradually came to herself after the shock of the news."
He shook his head, as if to come to himself.
— Charles Dickens, 'A Tale of Two Cities'