My first thought is please don't look at it like it's all-or-nothing; when i've slipped into old negative behaviors before, i made it worse by telling myself that it was hopeless, i was doomed, and i might as well go all-out and fail completely.
As for why this is happening now, it could be that something has surfaced that you aren't allowing yourself to think about consciously, but is pressing the buttons that were attached to those behaviors in the first place. It might also be that you've had an amount of positive self-perception recently that a part of you sees it as false, or believes that you don't really deserve it.
These are just some thoughts, i just wanted to let you know i know what it's like to "ambushed" too..
Give sorrow words: the grief that does not speak
Whispers the o'er-fraught heart and bids it break.
-William Shakespeare, Macbeth, Act IV, Sc. III