Shape-memory alloys have different shape-memory effects. The two common effects are one-way SMA and two-way SMA. A schematic of the effects is shown below.
The procedures are very similar: starting from martensite, adding a deformation, heating the sample and cooling it again.