flesh out revert_and_edit impl

Still needs a unit test.