Carbs or calories? I've done both and tried a fair number of diets, but had very limited success before I eliminated carbs aside from the small amounts in vegetables like carrots, broccoli etc
When I first bulged 2 discs about 5 years ago I initially lost 14 kgs in about 3 months, most of which was muscle mass. After I was off the pain killers, anti-inflammatories etc I put back on (and then some) 35kgs in about 12 months, but a lot of it was fat.
Even once I could exercise again I struggled to return to my prior weight/strength/fitness until I tried drastically reducing carbs, at which point I lost 20 kgs in 4 months while maintaining the same strength. I had also struggled to work effectively (mostly systems design, network design and some programming) on most diets (low fat, restricted calories, more frequent smaller meals etc) due to mental fog/fatigue, but I adjusted to a low carb diet after about a fortnight.