What is the reason for the gains? Have you been off plan?
When I fall off the wagon what I normally do is try to focus on one day at a time. In the morning I promise myself to stay on plan for one day. I mean what kind of a numpty can't stick to plan just for 1 day? (This is what i tell myself anyway). Then I try to do another day. Then 3. Then hopefully I manage a week, get a loss and remember why I'm doing it!
Some other ideas that might help and to look at before and after pictures ( yours and other peoples) for inspiration, and I agree with others get that exercise up (I hate the stupid term body magic), and go back to tracking.
My final piece of advice if none of that works is to look at another plan..
I was like you. I got to 7lb away from target last year as I wanted to lose it to do the Inca trail. After I'd done the trail in May 18 I maintained within a few pounds for 6 months or so, then this year I sneaked on a couple more so I was basically about a stone above target. Then I went on a cruise a few weeks ago and ended up about a stone and a half over target ( although still a stone and a half lighter than my heaviest).
Anyway, I just haven't been able to get into SW since Peru. I just think I got Slimming Worlded out / bored bored bored and I'm now doing something called Team RH which I'm really enjoying for a change of scenery. The losses are designed to be slower which is frustrating but it's very sustainable because of that. (It's basically calorie counting combined with exercise, but they give you more calories than most calorie based plans and make you eat them ) . Anyway, I think it's ideal for someone who only has a small amount to lose and might be worth a look and the change might help you to refocus.