Go back in history if possible.

        Return the undone item.
352483
def back(self):
        
        if self._index <= 0:
            return None
        undone = self.current_item
        self._index -= 1
        self._check_index()
        return undone
85086
def undo(self):
        '''  '''
        if self.canundo():
            undoable = self._undos.pop()
            with self._pausereceiver():
                try:
                    undoable.undo()
                except:
                    self.clear()
                    raise
                else:
                    self._redos.append(undoable)
            self.undocallback()
108552
def getTradeHistory(pair, connection=None, info=None, count=None):
    """"""

    if info is not None:
        info.validate_pair(pair)

    if connection is None:
        connection = common.BTCEConnection()

    response = connection.makeJSONRequest("/api/3/trades/%s" % pair)
    if type(response) is not dict:
        raise TypeError("The response is not a dict.")

    history = response.get(pair)
    if type(history) is not list:
        raise TypeError("The response is a %r, not a list." % type(history))

    result = []

    # Limit the number of items returned if requested.
    if count is not None:
        history = history[:count]

    for h in history:
        h["pair"] = pair
        t = Trade(**h)
        result.append(t)
    return result
855902
def reverse_search_history(event):
    
    event.cli.current_search_state.direction = IncrementalSearchDirection.BACKWARD
    event.cli.push_focus(SEARCH_BUFFER)
966839
def get_or_404(self, mongo_id):
        """"""
        document = self.get(mongo_id)
        if document is None:
            abort(404)
        return document
293873
def reverse_search_history(self, e):  # (C-r)
        '''
        log("rev_search_history")
        self._init_incremental_search(self._history.reverse_search_history, e)
        self.finalize()
1032171
def undo_last_change(self):
        
        if len(self.history) == 0:
            raise IndexError("Can't undo. Already at oldest change.")
        if 'input_structure' not in self.history[-1]:
            raise IndexError("Can't undo. Latest history has no "
                             "input_structure")
        h = self.history.pop()
        self._undone.append((h, self.final_structure))
        s = h["input_structure"]
        if isinstance(s, dict):
            s = Structure.from_dict(s)
        self.final_structure = s
1168778
def split_history_item(history):
    
    try:
        log_file, description = shlex.split(history)
    except ValueError:
        log_file = history.strip()
        description = None

    return log_file, description
1013474
def get_history_user(self, instance):
        """"""
        try:
            return instance._history_user
        except AttributeError:
            request = None
            try:
                if self.thread.request.user.is_authenticated:
                    request = self.thread.request
            except AttributeError:
                pass

        return self.get_user(instance=instance, request=request)
127082
function (to, createHistoryEntry, triggerRoute, force, callback) {
                return this.history.navigate(to, createHistoryEntry, triggerRoute, force, callback);
            }
322641
def previous(self):
        
        if self._order_by == 'oldest':
            return self.older
        if self._order_by == 'newest':
            return self.newer
        return None
708462
def _get_history_next(self):
        
        if self._has_history:
            ret = self._input_history.return_history(1)
            self.string = ret
            self._curs_pos = len(ret)
1093063
def history_backward(self, count=1):
        
        self._set_history_search()

        # Go back in history.
        found_something = False

        for i in range(self.working_index - 1, -1, -1):
            if self._history_matches(i):
                self.working_index = i
                count -= 1
                found_something = True
            if count == 0:
                break

        # If we move to another entry, move cursor to the end of the line.
        if found_something:
            self.cursor_position = len(self.text)
833355
def undo(self, hard=False):
        """"""

        if not self.fake:
            return self.repo.git.reset('HEAD^', working_tree=hard)
        else:
            click.echo(crayons.red('Faked! >>> git reset {}{}'
                                   .format('--hard ' if hard else '', 'HEAD^')))
            return 0
1174786
def get_log_file_from_item(history):
    
    try:
        log_file, description = shlex.split(history)
    except ValueError:
        log_file = history.strip()

    return log_file
15752
def goBack(self):
        
        index = self.indexOf(self.currentEditor())
        if index == -1:
            return
        
        previous = self.editorAt(index - 1)
        if previous:
            previous.setFocus()
            previous.setCursorPosition(self.sectionLength())
604555
def get_result(self, commit, default=MemoteResult()):
        """"""
        assert self._results is not None, \
            "Please call the method `load_history` first."
        return self._results.get(commit, default)