Improved revert operation to add better handling of conflict cases