# Work done by elastic force

I have a doubt about the work done by elastic force.

The general formula of the work is: $$W_{Fe} = \frac{1}{2}k(x_0^2-x^2)$$; if we take that the state in which the spring is at rest, we have: $$W_{Fe} = -\frac{1}{2}kx^2$$ for both cases where the spring is compressed and stretched. But, isn't this contrary to the fact that work is a conservative force? since that $$W_{Fe}+W'_{Fe}=$$ $$-\frac{1}{2}kx^2-\frac{1}{2}kx^2 \not = 0$$

($$W$$ represents the case in which the spring passes from the compression position to the stretched position, and W 'the other way round)