package tars.logic.commands;

/**
 * Undo an undoable command.
 * 
 * @@author A0139924W
 */
public class UndoCommand extends Command {
    public static final String COMMAND_WORD = "undo";

    public static final String MESSAGE_SUCCESS = "Undo successfully.";
    public static final String MESSAGE_EMPTY_UNDO_CMD_HIST = "No more actions that can be undo.";

    @Override
    public CommandResult execute() {
        assert model != null;

        if (model.getUndoableCmdHist().size() == 0) {
            return new CommandResult(MESSAGE_EMPTY_UNDO_CMD_HIST);
        }

        UndoableCommand command = (UndoableCommand) model.getUndoableCmdHist().pop();
        return new CommandResult(MESSAGE_SUCCESS + "\nAction: " + command.undo().feedbackToUser);
    }

}

@@ -255,16 +255,91 @@
 ully.%22;%0A
+    public static final String MESSAGE_UNSUCCESS = %22Undo unsuccessfully.%22;%0A
     publ
@@ -729,32 +729,84 @@
 .pop();%0A        
+model.getRedoableCmdHist().push(command);%0A        //
 return new Comma
@@ -879,16 +879,47 @@
 oUser);%0A
+        return command.undo();%0A
     %7D%0A%0A%7D

Modify execute method