I will go nemonis one further... be sure to carry a spare tube in the future for either your needs or for the needs of someone you may come across that needs help.
Also as long as we are discussing self rescue... wrap some duct tape around itself or better yet, a frame pump and carry it. Duct tape can be used to make a temporary tire patch or to hold a loose part in place. Doesn't hurt to carry a couple cable ties either.
Helps to keep you from "being screwed."