How do I move on?

Almost a year ago I started to develop feelings for a guy who I knew I shouldn't have been. He was bad news all around but he seemed to be trying to change. Anyways, we hung out one night and while playing truth or dare we kissed. After he left he texted me and let me know he had feelings for me and I told him that I liked him back. We then began talking and we stayed really happy and in like for a couple of months. Then one February morning I found out my uncle had passed away and I went to go be with family but it was all just too much so I left to hang out with this guy. He was being so caring and I was so glad I met him. Then he said he had to leave and just walked out quickly. Two days later at school I got a text from his ex-girlfriend saying that they were getting back together because she was pregnant with his baby. I completely understood why he wanted to get back with her, I really did. But the only reason I was mad was because I had to find out from her, not him. Anyways, it ended pretty badly and now he's like best friends with my cousins who I'm really close with and he's always popping up. I really liked him and my friends always tell me How great we were together and now I'm always thinking about getting back with him. I know he doesn't have feelings for me anymore but that still doesn't push me away. what should I do?