The nerve you are referring to is called the median nerve. Since the nerve is being compressed under a tough band called the flexor retinaculum, your doctor has rightly recommended surgery. The operation involved slitting the tough band of tissue, thus freeing the nerve. The operation is relatively simple and safe in the hands of an expert.
This is the ideal form of treatment once there is EMG evidence of such compression.
Alternative forms of treatment involve exercises under the supervision of a physiotherapist, the use of a restraint that will prevent flexion at the wrist and the injection of a corticosteroid drug around the nerve.
Please consult your doctor before making a decision.