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_NO_CHANGE = "No change to be undone";

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

    public CommandResult execute() {
        if (!model.getFlag().equals("undo copy")) {
            return new CommandResult(MESSAGE_NO_CHANGE);
        } else {
            model.resetData(model.getCopy());
            model.clearCopy();
            model.updateFlag("empty copy");
            return new CommandResult(MESSAGE_SUCCESS);
        }
    }
}

@@ -652,39 +652,8 @@
 ));%0A
-            model.clearCopy();%0A
     

Remove unnecessary method calls in undo command