When polymorphed, you use the stat block of the creature you're transformed into. When it ends, you take excess damage to your normal HP, but are otherwise unharmed.
The Wild Magic effect in question duplicates the Polymorph spell, which says the following:
The transformation lasts for the duration, or until the target drops to 0 hit points or dies. The new form can be any beast whose challenge rating is equal to or less than the target’s (or the target’s level, if it doesn't have a challenge rating). The target’s game statistics, including mental ability scores, are replaced by the statistics of the chosen beast. It retains its alignment and personality.
The target assumes the hit points of its new form. When it reverts to its normal form, the creature returns to the number of hit points it had before it transformed. If it reverts as a result of dropping to 0 hit points, any excess damage carries over to its normal form. As long as the excess damage doesn’t reduce the creature’s normal form to 0 hit points, it isn’t knocked unconscious.
While there is no stat block for sheep, there is a Sage Advice post that gives some rough guidelines for stats for sheep. According to that post, a Sheep uses a modified version of the goat statblock, which has 1d8 (average 4) HP. As a result, unless the shearing deals more that 4 damage to your HP, you should be unharmed upon returning to your natural form.