The surgery you underwent changed the look of your body significantly, correct? I know there have been reports of people who experience mental and emotional issues after those types of procedures. The mind is used to seeing the body one way and then it experiences a type of shock as it tries to integrate the old you with the new you. I know this was something you wanted, but it is still a major change. Also, you're dealing with trauma to the body and hormonal shifts in combination with the mental aspect. It is a lot to process and it may take some time.
You asked how long it will take to get back to the old self. Maybe the question is really how long will it take to find your new self? What you had in the past is gone. It lives in the past. You are in the now. Clinging to it and trying to recreate it can a painful and frustrating experience. The new you may end up being very similar to the old you, but it may help you mentally to be open to a shift as something different may be a better fit now.