In answering this question, the first issue is if the damage is material to the contract or is instead merely ancillary. To illustrate, lost electric or a few shingle down is likely immaterial, whereas flooding with structural damage is typically material.
If material, the contract is unenforceable at the option of the purchaser (the seller has no option). In this scenario, if the purchaser does not want to pursue the contract and therefore does not want to close on the real estate transaction, the purchaser can have their deposit (Earnest Money) returned.
If immaterial, the contract is enforceable, but the purchaser has a right to an abatement (reduction) of the purchase price reflecting the damage.
Nonetheless, if there is a prepossession agreement and the purchaser is in possession, regardless if the damage is material, the contract is enforceable as is.
These are the default rules embodied in General Obligation Law 5-1311, but a contract of sale can be drafted to amend these rules however the parties agree. Therefore, it is imperative that you review your contract of sale before you act.