My friend Charlie is back....

https://slrpnk.net/post/35738966

This fixes it instantly every time for me. Ignore everybody else. When you get that cramp start moving our foot in the opposite direction pointing your toes towards your knees and stretch out the back of your ankle. Instant cramp relief everytime.

If you have cramping often like this then maybe dedicate yourself to some hamstring stretches.

This trick has become a reflex for me, to the point where I barely even wake up when I get a Charlie horse in the middle of the night, since I start flexing my foot automatically when I feel it coming on.