Well, you can rest easy knowing that it isn't money that goes away - the full deposit goes towards the purchase of the home, and a strong good faith deposit can help your chances of getting an offer accepted.
According to an article from Realtor.com, "the earnest money deposit is an important part of the home buying process. It tells the seller you're a committed buyer, and it helps fund your down payment. Without earnest money, you could make offers on many homes, essentially taking them off the market until you decided which one you liked best. Sellers rarely accept offers without deposits." (Read the full article HERE).