Hooke's Law can be applied to both extension and compression, and applies most accurately to metal springs and wires, but can also be approximated to other materials or used for small deformations
During unloading, work is done by the material to regain its shape, and energy is recovered and dissipated to the surroundings, equal to the areaunder the unloading curve
The difference between the energy transferred to the material during loading and the energylost by the material during unloading is stored as internal energy, causing the material to heat up