If you paid by check then you're probably best served to put a pay stop on the check through your bank. If you paid online then first go back on line to the Donations page and see if it's still processing. If so, then you should be able to cancel it.
If the check has already cleared or if an online donation has already been processed then you'll need help from your bishop and ward clerk. The clerk should contact the
Global Service Center and indicate that you need a refund of your donation because it was a mistake. The representative should give your clerk an email address to send the request to. The bishop will then need to send an email requesting the refund and indicating his belief that it was a mistake and that not refunding the donation would be a hardship. For an online donation in our ward the refund was approved and processed by the end of the week after we started the process but there is no guarantee on the time frame.