Function revertLocalChanges