LMS-11185 Split implementation of revert_to_published

@dmitchell Please review.