Whenever this happens you need to check the bead on the tire for being bent. Sometimes when a tire lifts off the rim it bends the wire bead that holds it in place. That makes it much more likely to happen again when you put in a new tube and inflate the tire. Whenever you install a new tube (did it yesterday on a 700C tire) slightly inflate to tube before putting it inside the tire casing. Then re-seat the tire on the rim and check along the entire tire to make sure that no part of the tube is caught between the tire bead and the rim. The last thing I do before inflating the tire is to push the valve in toward the tire and pull it back out before I install the nut on a presta valve. Then you know the valve is properly seated. I learned this the hard way while working in a bike shop. I was fixing a flat for a customer when POW the tire blew up on me. Not only did I have to give the customer a new tube but we replaced the tire for free as I had indeed bent the bead where it lifted off the rim.