Bear with my because this is quite a long and complicated story....
So over the past few weeks, I have started to develop this 'relationship' with a work colleague. There was always an attraction since we first met but nothing other than fancying each other. We hardly spoke or interacted much a work. One night a few weeks ago, I went out for drinks with this guy as well as another colleague. We had a little too much to drink and ended up kissing a few times. This was completely out of character for me because I never imagined I would go there and this guy also has a girlfriend who he has been with for a number of years. The following day, I thought it would be a bit awkward but messaged him to apologise for it happening and really just to find out what he thought of the situation. He didn't seem to think it was much of a big deal but didn't regret what happened, which really confused me but carried out with my weekend as normal. Monday comes around and things are still normal between us. Nothing awkward or odd. A few days later we start messaging each other quite a lot. Practically all day every day even when we are sat a few yards away from each other in the office. Over time the attraction grew and he started to tell me how bad his relationship was. There was a lack of emotional and physical connection between him and his girlfriend but he felt the need to stick around for his daughter which I understood. Eventually, his partner found out that he had been messaging someone, not me but someone so she kicked him out. I spoke to him and it sounded like things were dead in the water and he wouldn't go back there. He moved out and appeared to be moving on with his life. We then started having a physical relationship and our feelings for each other grew deeper. There were times where his ex would get in touch with him and would be quite possessive. Threatening that he would never see his daughter again etc. So it came as a massive surprise when after the Easter bank holiday he met with me and told me that he had met with his ex over the weekend, she had apologised for how she had neglected him and they have decided to try and give things another go. For the sake of his daughter, he wanted to try and make things work. I understood this and accepted his decision. Stupidly we slept together for the last time and as a 'goodbye' (really stupid I know). The next couple of days passed as normal, no contact only at work.
Then for the past week, he has been messaging me being flirty. I have tried not to be flirty back and have tried to build some boundaries. I have spoken to him about how I feel and he seems to feel the same way about me and the feelings are still there. He has said that he can see himself being in a proper relationship with me and he knows he would be happy, but why has he gone back to a woman who treated him badly and was so abusive when they broke up? I am quite frankly a bit heartbroken and I feel that I have fell for this guy in one way or another.
It now feels like he has gone back to her but wants to still flirt with me and keep me around. I am so confused, what do I do?