Stretch one’s legs

To walk around after sitting down or lying down for a period of time.

We stopped to stretch our legs after driving for several hours.