package seedu.jobs.logic.commands;


/**
 * Undo last commands which has modified the data.
 */
public class UndoCommand extends Command {

    public static final String COMMAND_WORD = "undo";

    public static final String MESSAGE_SUCCESS = "Undo last command";


    @Override
    public CommandResult execute() {
        model.updateFilteredListToShowAll();
        return new CommandResult(MESSAGE_SUCCESS);
    }
}

@@ -29,16 +29,83 @@
 mands;%0A%0A
+import seedu.jobs.model.task.UniqueTaskList.TaskNotFoundException;%0A
 %0A/**%0A * 
@@ -390,44 +390,164 @@
     
-model.updateFilteredListToShowAll();
+try %7B%0A            model.undoCommand();%0A        %7D catch (TaskNotFoundException e) %7B%0A            assert false : %22The target task cannot be missing%22;%0A        %7D
 %0A   

handle exception in UndoCommand