The ability holder will have a 50% chance to recover their used berry. Harvest always activates in harsh sunlight. The used is remembered even if the berry is not restored when it was last out, but once the Pokémon consumes a new item, it will be wiped and Harvest will no longer activate.
Harvest can recover Berries consumed by Fling and Natural Gift but, Harvest cannot recover Berries transferred to another Pokémon, Berries destroyed by Incinerate, Berries knocked off with Knock Off, or Berries eaten with Bug Bite or Pluck. Harvest cannot restore a Berry if it is collected by a Pokémon with Pickup.