I didn't have the rug pulled out from under me quite like you. For me it was three years after a first reconciliation that was already a long, rough process. In those three years everything had improved in out marriage, I invested considerable time and effort in our relationship, new house etc.
The bottom line for me is that it didn't matter what I did because I could fix her issues, only she could do that. I didn't know that when she came back I was still plan B, the OM decided he wasn't going to be available to her the first time around but the minute he changed her mind gone she was.
What has been helpful for me to shift my focus off of them and on to myself and GAL is to decide how I would live/proceed if this happened another 2,3,5,10 times. How many times will you let this person walk all over you after a reconciliation. That notion of not having control over them changing their lives allowed me to shift my focus to the things I can control.
I've also found it helpful to mourn or grieve the relationship. It's dead, it can't be the same, the person who I married no longer exists. By mentally moving on as if they have passed away has helped to detach immensely, even allows me to appreciate the good times for what they were. As for the new person they've become, I'm friendly and we work together to co-parent, but they are just an acquaintance.
Not sure if any of that helps but I feel your pain and hope things improve for you soon. Without the need of someone else to make that happen for you.
H-36 W-34 T-11 M-9 Daughter-8 Bomb 1st - 2011, 2nd 2015 Same OM Separated Aug 2015 (same house, separate suite)