Highschool crush PLEASE HELP

Theres this guy who I liked at the beginning of the year, (thats when i met him) who also liked me. He was hesistant to date me at first because he was just getting over a summer fling. He then starting dating this girl about 3 weeks later who went to a different school. He knew her brother so it worked out well. By the way, I haven't stop liking him. He has a flirty personality so a lot of girls like him, even though he isn't extremely "popular". They have now been dating for less than 7months, and when it was their 6month anniversary, it killed me inside. Other guys have wanted to date me, but I didn't date them bc I was hesitant. I still liked this boy who was already in a relationship. the two of us are still good friends, but I was texting him today. Just contemplating life, bc recently I've been going thru a lot, like losing my friend group and having my uncle die. So we talked and he wanted to know who i liked. I didnt want to tell him but on his second guess, he guessed correctly. Himself. Now, He said hes gonna tell his gf, but I liked his gf in general and dont want them to break up. I would hate myself for it. He just texted me that he told her and I don't know what I'm going to do. She's going to hate me. I felt better though after I told him bc its been keeping me up and night and hes been in so many of my dreams. Advice?? Should I wait for him or move on?