You can think again of the analogy of a ball. A ball, when thrown, speeds in the direction it is thrown; There is no thought to what it does. So, if you think of the person "like a ball" he is acting thoughtlessly "carried by the wind" and then suddenly he understands his action and stops doing it. He "catches" the thoughtless "ball" and becomes himself again.
It's really such an interesting phrase, because it shows how complicated people are and the things they do!