Theoretically, the earnest money is yours if the buyer backs out for no sound reason. I have never heard of anyone keeping the earnest money, though. If I were you, I would simply rescind the acceptance of the buyer’s offer under the grounds that they abandoned the deal and relist the house.
The only way you can keep the earnest money is if the buyer agrees or you sue (hopefully small claims court). On the other hand the only way the buyer can get the earnest money back is if the seller agrees or the buyer sues the seller.