If the action is non-destructive, as easy to undo as it is do, and the users actions are not being constantly reversed then I would not add any friction to the flow.
If on the other hand the re-share action requires significant effort, or the user is struggling with this I might add a user configurable warning, that is let the user decide in place whether to keep warning about this.
The above statements assume there are no structural issues during usability testing with "everyone" un-sharing then re-sharing which would point out a more fundamental issue that a confirmation mechanism would just mask.
Adaptive behavior is something that can be useful if you can get the dev's to swing it, pick and choose your battles though. Generally if pairs of unshare/share are happening within a preset timebox for a user and the configurable option was turned off then automatically resurfacing it might be appropriate.
You could also use the same mechanism to surface the warning initially if the res-sharing friction is higher but usability testing shows most people getting it (repeatably) right.
The same mechanism can be used to determine general usability problems in the field if these metrics are tracked to better understand the impact of these kinds of decisions but I find very few people actually thinking this stuff out in a root cause kind of way instead if they get a few complaints they just add a warning mechanism that ends up being worse than the cure for the majority of users.
If this is a web app it should be simple enough to do the global analytic's, which I usually add if I have questions that can't be answered pre-ship, or complaints/defects are being logged.
The internals though require more developer effort though so if you don't already have a framework built in to do this then good luck ;-)