Sometimes I get leg cramps in bed and I've found that I have to pull my toes upward to make it recover. Doing that seems to release whatever is cramping up for me after a few seconds.
I used to have to get out of bed and stand on it before I discovered the other trick.