George Diebold/Getty Images

It’s happened to everyone—you buy plane tickets to visit a college friend in Houston or for a girls’ weekend in Charleston and a few hours after purchasing nonrefundable tickets something comes up. As the saying goes, the best laid plans of mice and men and especially vacationers often go awry. 

While some people opt to purchase refundable tickets in case travel plans change, most of us don’t want to pony up the extra cost for an already expensive plane ticket. That means that if you can’t use your plane ticket or you need to change your dates, you are stuck with no recourse for getting your money back—usually.

As Reader’s Digest reminded us, there’s an often forgotten federal law that requires airlines let you cancel or change a ticket within 24 hours of purchase. That means that if you book a ticket, and then your sorority sister or sister-in-law or husband announces that they actually need to leave on Sunday instead of Friday, there’s a window to change things. The best part is that it’s absolutely free.

WATCH: The Best Week to Book Domestic Flights to Save Money on Summer Travel

The law has been on the books since April 2011 and while airlines are required to notify ticket buyers of this 24-hour return policy, they can be pretty sneaky about it. For example, they may only mention this right on a customer service page buried in their website. Now that you know about the law, though, you can demand your rights. If you do change your mind about a ticket within the 24-hour window, cancel the ticket on the website or call the airline and make a cancellation request and they must offer you a full refund in the original form of payment.

That said, there are a few things to be aware of:  First, Under the Department of Transportation’s regulations, the 24-hour cancellation rule only applies if you book your flight at least seven days before departure. That means you can’t book a ticket to New Orleans tomorrow and then change your mind. However, if you drink a few too many Sazeracs and book a plane ticket to next year’s Mardi Gras only to change your mind when you wake up in the morning, you should be okay to cancel your ticket for a full refund.

Second, if you book a ticket through a travel website like Orbitz or Expedia, your ticket may not be subject to this rule as it only applies to commercial airlines. Of course, some of these travel sites offer even better cancellation policies and more than 24 hours to return your tickets. For example, Priceline may give you the weekend to rethink your travel plans if you book on a Friday, according to Travel + Leisure. It pays to be cautious and read the fine print, when you are booking via a third-party site.