package seedu.address.logic.commands;

public class UndoCommand extends Command {

    public static final String COMMAND_WORD = "undo";
    public static final String MESSAGE_USAGE = COMMAND_WORD;
    public static final String MESSAGE_SUCCESS = "Successfully undo previous change";
    public static final String MESSAGE_ERROR = "Cannot undo previous change";
    public static final String MESSAGE_NO_CHANGE = "No change to be undone";

    /**
     * Default empty constructor.
     */
    public UndoCommand() {
    }

    public CommandResult execute() {
        model.resetData(model.getCopy());
        model.updateCopy(model.getTaskManager());
        return new CommandResult(MESSAGE_SUCCESS);
    }
}

@@ -281,86 +281,8 @@
 e%22;%0A
-    public static final String MESSAGE_ERROR = %22Cannot undo previous change%22;%0A
     
@@ -354,16 +354,16 @@
 ndone%22;%0A
+
 %0A    /**
@@ -472,24 +472,157 @@
 execute() %7B%0A
+        if(model.checkChanges()) %7B%0A            return new CommandResult(MESSAGE_NO_CHANGE);            %0A        %7D%0A        else %7B%0A    
         mode
@@ -663,50 +663,35 @@
     
+    
 model.
-updateCopy(model.getTaskManager());%0A
+clearCopy();%0A    
     
@@ -736,16 +736,39 @@
 UCCESS);
+            %0A        %7D%0A
 %0A    %7D%0A%7D

implement check undoable changes in UndoCommand class