Flips

My baby has been head down since about 21 weeks. I'm 27 weeks today & yesterday when I woke up I could tell he had flipped breach because all I felt was movements by my bladder & cervix. Last night my stomach got a horrible gas like pain for about 3 mins & stopped. I noticed he was moving higher up. He had flipped back head down. This morning I've been feeling his feet close to my ribs. I'm so glad he is back head down. It is SO UNCOMFORTABLE when he is breach. I hope he stays that way & doesn't continue to flip back & fourth. 
Anyone else's baby does this? When did they finally stay in a position?