I was expecting the cacti to look a lot worse.
(That is to say, after you described what happened to the cactus and that it was rotting and dying, to see the picture I thought he looked like he was going to be OK! I'm just being honest, hehe, I think he will recover. Cacti are pretty tough!)
The worst thing you can do to a cacti is water it to much, like the commenters above had said.
Oh goodness. When I first got a cacti my friend gifted to me? I don't know what I was thinking. I think I almost liked the way... that... if you water a cacti a bunch it bulges and just gets bigger? So I kept watering it and watering it and watering it. Don't do this! (I'm glad to hear you aren't doing this, heh)
Then I happened to be like, "hey let's go read some cacti care info!" one day... to find... I was trying to kill my cactus inadvertently?
I probably watered it every other day for a few months because I liked watching it swell. How awful!
I apologized to the cactus and let it dry out... well, forever. It is two years later and it has like 12 flowers on it, we now have a happy understanding of eachother! Well, at least, I, it.
I am sending your cactus good vibes!
I can't really see the bottom of the cactus in the picture you posted, but I have read somewhere that "discoloration" at the base of the cactus can be normal? (Maybe even more so if a cacti was in the dark for 2 months? I dunno, hehe, but like he said, he looks cute to me, or I have hope at least!
You could post a close up picture of the bottom discoloration if you wanted to discuss it further. I am happy you have rescued the cactus from the dark and are doing all you can to help him! (Sorry I masculinized "it", haha) - In my opinion, the cactus is thankful you are helping it too!! just wanted to say that part: that no matter what happens, I am glad you are trying to save it and the cactus can sure "tell" it's not in the dark any more. It's definitely suffering less!