A restoring force is a force exerted on a body or a system that tends to move it towards an equilibrium state.
For a spring, the restoring force is a force that the spring exerts on its ends to restore it to its natural length, or relaxed length. When the spring is compressed, this force is exerted outwards on both ends of the spring, and when the spring is stretched, this force is exerted inwards.
A reasonable approximation for small deformations is Hooke's law, which states that the magnitude of the restoring force is proportional to the magnitude of the displacement from the natural length, and the direction is opposite. The constant of proportionality is termed Hooke's constant.