As a resident moderator/engineer. I'll chime in. Its Hooke's law, (F=kx). It does relate to springs in compression as well as tension, however, the constant k, is not always as simple as a number. Progressive springs for instance vary the force required to compress them. (So K would either be several linear values, or a differential equation)
So the basic rule, is however much you squish the spring to install/remove it, all that force can come back in an instant if you let it.