I saw my ex - any advice?

And it really shocked me to the point I had a panic attack. I just started shaking and I couldn't breathe properly. I was overwhelmed by all the pain from out break up and I guess it just hit me. I've been doing so well lately and this happened and I've been better I've become a completely different person compared to when we were together. I'm confident and happy and outgoing and feel independent. I'm not a shy timid girl like when I was when we dated. But this effected me badly. I'm okay now and I calmed down cause my mum helped me and I know I never wanna go back there but it's just hard. All these memories come back and the pain and the heartache but also the good we had. I just wanna forget about him. I'm struggling today a bit (this happened last night) and I feel a bit emotional cause I'm just thinking about it and him. does anyone have any advice for me? I'll appreciate anything thank you