So me and my girlfriend (A) had been together for over three years when we broke up. Near the end of our relationship A warned me that a female friend (B) of mine was being overly flirty, and A had become quite paranoid about B and I spending time together. This is fairly out of character for her and I hadn't given any reason for her to be suspicious. Me and A broke up around November for completely unrelated reasons (I ended things to focus on work and generally needing some time to myself. About two-three weeks later, B stayed at my house after we had gone to the pub with some mutual friends (she lives quite far away and was too drunk to drive). B ended up trying to sleep with me but I said no due to the fact that it might hurt A. B then got quite upset and threatened to drive home/ leave and sleep at another friends house. I managed to calm her down and she told me she respected my decision to not sleep with her. But then tried to sleep with me again until I gave in and had sex with her. I should clarify here that I did want to have sex with her but was in quite a bad place with the breakup and mainly wanted to feel wanted. After that night B and I continued sleeping together frequently for about another month. I ended up seeing A in December and told her everything that had happened. She was reasonably hurt and explained that she had been having a hard time with being broken up and wanted us to stop being in contact so she could move on. 
I never really wanted the break up to be perminant and I said to A that I hoped we would get back together eventually. Recently, A and I spoke and I explained that I still loved her and wanted us to be together again, she said that it wasn't feasible at the moment as she's still very hurt from everything that happened between me and B, and she still wants to focus on moving on. So, AITA? I feel like a monumental tool, and all I can do is sit around and think about the mistakes I've made. Do you think this is something that we can recover from or have I been to much of an asshole? 

TL;DR: I broke up with my girlfriend and ended up sleeping with a female friend who my grilfriend was - quite rightly - suspicious of. Now I want my girlfriend back but she's understandably hurt by my actions.