bend them in the other direction, Bu do so gnetly over your knee, Moving it from side to side while applying tiny bits of pressure in order to slowly work the foam back the other way.
Equally storing it the same way you were storing it but the other way up can do it if it was a humidity/support issue.