<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def scroll_up(self):
 """ Returns the previous command, if any. """

        self._index += 1
        nb_commands = len(self._history)
        if self._index >= nb_commands:
            self._index = nb_commands - 1
        try:
            return self._history[self._index]
        except IndexError:
            return ''