class ChefCLI::PolicyfileServices::Undelete

def run

def run
  if undo_record_id
    if undo_stack.has_id?(undo_record_id)
      undo_stack.delete(undo_record_id) { |undo_record| restore(undo_record) }
    else
      ui.err("No undo record with id '#{undo_record_id}' exists")
    end
  else
    undo_stack.pop { |undo_record| restore(undo_record) }
  end
rescue => e
  raise UndeleteError.new("Failed to undelete.", e)
end