It has happened to me too many times, and I can't think of anything in specific. Perhaps go drink some water, read a book, etc. I think the best solution is to see why are you waking up in the middle of the night. Are you exercising? Are you under a lot of stress? Ideally you should go to bed, have a very peaceful sleep and only wake up the next day in the morning. If that's not happening, there's probably something wrong in your routines. Regular physical activity help you sleep better. Healthy eating too. Stressing events or some medications can disturb your sleep.
When I'd wake up in the middle of the night it was because I wasn't exercising and was under a lot of stress. When I started exercising and managed the causes of my stress, things improved 10x.