Rehabilitation is the process of bringing something back to a former condition. It has a number of different connotations, depending on the usage.
In terms of medicine, rehabilitation typically refers to the restoration of the body (or parts thereof), usually as part of the healing process after injury. For example, Captain Jean-Luc Picard required rehabilitation to recover from his injuries upon being released from the Borg. (TNG: "The Best of Both Worlds, Part II")
Rehabilitation may also refer to the concept and/or process of assisting convicted criminals in changing their mindsets or lifestyles to allow them to rejoin society and avoid committing further crimes in the future. The notorious conman Harry Mudd was eventually sentenced to rehabilitation therapy for his crimes. (TAS: "Mudd's Passion")