56:2 If one erred and recited ho’adomah over a fruit whose bracha should be ho’eitz (or even if he did so intentionally – MB 206:1), or if he had both types of produce in front of him and he accidentally said ho’adomah with the intention to include the item whose bracha should be ho’eitz, this is valid after the fact because trees also draw their nourishment from the ground. (The same is true if, for example, one said shehakol over something whose bracha should be ho’adomah – MB 206:9.) However, if one recited ho’eitz over something whose bracha should be ho’adomah, it is not effective even after the fact. Therefore, if one is in doubt as to a fruit’s proper bracha and there is no way for him to find out, he should recite ho’adomah over it.
56:3 If someone accidentally recited ho’eitz over wine, if he realized immediately, he should recite the bracha of hagafen. If he did not realize immediately, the bracha he recited is effective after the fact. (“Immediately” means the time it takes to say the words “shalom alecha, rebbe” – see Mishnah Brurah 487:4 and 206:12. Some say that the bracha of ho’eitz is not effective even after the fact but we nevertheless do not recite a new bracha in this instance because we rule leniently when it comes to doubt in a case of brachos – MB 208:70.)