Revert the previous modification to the refpkg.
186067
def rollback(self):
        
        # This is slightly complicated because of Python's freakish
        # assignment semantics and because we don't store multiple
        # copies of the log.
        if self.contents['rollback'] is None:
            raise ValueError("No operation to roll back on refpkg")
        future_msg = self.contents['log'][0]
        rolledback_log = self.contents['log'][1:]
        rollforward = copy.deepcopy(self.contents)
        rollforward.pop('rollback')
        self.contents = self.contents['rollback']
        self.contents['log'] = rolledback_log
        self.contents['rollforward'] = [future_msg, rollforward]
        self._sync_to_disk()
345027
function trimNested(previous, current, opts) {
    // bail early if we want to keep nested dependencies
    if (opts.keepNested) {
        return current;
    }

    // purposes find patches from to
    // apply TO current FROM previous
    var patches = jsonDiff.diff(current, previous);

    if (!patches) {
        return current;
    }

    patches = removeTopLevelPatches(patches);

    if (patches.dependencies) {
        Object.keys(patches.dependencies)
            .forEach(function (key) {
                current.dependencies[key] =
                    previous.dependencies[key];
            });
    }

    return current;
}
751179
def delete(self):
        """"""
        try:
            self.revert()
        except errors.ChangelistError:
            pass

        self._connection.run(['change', '-d', str(self._change)])
713893
def teardown(self):
        """"""

        for proxy in self._proxies.values():
            proxy.restore_original_object()

        for patch in self._patches.values():
            patch.restore_original_object()
1359575
def clear(self):
        """"""
        self._config = configparser.RawConfigParser()
        # Override config from command line even if we modify the config file and live reload it.
        self._override_config = {}

        self.read_config()
379525
def reset(self):
        """"""
        paths = []
        for filename in os.listdir(self.cached_repo):
            if filename.startswith(".git"):
                continue
            path = os.path.join(self.cached_repo, filename)
            if os.path.isfile(path):
                paths.append(path)
            elif os.path.isdir(path):
                for model in os.listdir(path):
                    paths.append(os.path.join(path, model))
        git.remove(self.cached_repo, paths)
        self.contents = {"models": {}, "meta": {}}
1043965
def reapply(config):
    """"""
    with open(config, 'r'):
        main.reapply(yaml.load(open(config)))
212997
def revert(self):
        
        if self.program_fp:
            self.program_fp.close()
        super(ProgramRunner, self).revert()
1086104
def undo_bundler
      clean_env = nil
      Bundler.with_clean_env do
        clean_env = ENV.to_hash
      end
      ENV.replace(clean_env)
    end
1194747
def replace(self, old, new):
        """"""
        if old.type != new.type:
            raise TypeError("new instruction has a different type")
        pos = self.instructions.index(old)
        self.instructions.remove(old)
        self.instructions.insert(pos, new)

        for bb in self.parent.basic_blocks:
            for instr in bb.instructions:
                instr.replace_usage(old, new)
1322410
def revert(self):
        
        for attr, value in self._changed.items():
            setattr(django_settings, attr, value)
        for attr in self._added:
            delattr(django_settings, attr)
        self._changed = {}
        self._added = []
        if self.isolated:
            self._isolated_overrides = BaseSettings()
640037
public function revert()
    {
        $this->order = $this->order == 'ASC' ? 'DESC' : 'ASC';

        if (empty($this->raw_data)) {
            return;
        }

        $data = $this->get();
        $data = array_reverse($data);
        $this->raw_data = implode(self::SEPARATOR_ELEMENT, $data);

        $this->meta['pos'] = array();
    }
654689
public function revertFormat() {
        $allFormats = $this->getPreviousFormats();
        if(!empty($allFormats)) {
            $this->currentFormat = array_pop($allFormats);
            $this->setPreviousFormats($allFormats);
        }
    }
113510
def modify(self, sort=None, purge=False, done=None, undone=None):
        
        self.model.modifyInPlace(
            sort=self._getPattern(sort),
            purge=purge,
            done=self._getDone(done, undone)
        )
196725
def undo(scm, verbose, fake, hard):
    """"""
    scm.fake = fake
    scm.verbose = fake or verbose

    scm.repo_check()

    status_log(scm.undo, 'Last commit removed from history.', hard)
1036599
public final void revert() {
        if (isBuffering()) {
            if (logger.isDebugEnabled()) {
                logger.debug("Reverting buffered value '" + getValue() + "' to value '" + wrappedModel.getValue() + "'");
            }
            setValue(wrappedModel.getValue());
        }
        else {
            if (logger.isDebugEnabled()) {
                logger.debug("No buffered edit to commit; nothing to do...");
            }
        }
    }
1247764
def _revert_tag_in_init(self):
        
        for line in fileinput.input(self.init_file, inplace=1):
            if line.strip().startswith("__version__"):
                line = "__version__ = \"" + self.init_version + "\""
            print(line.strip("\n"))
        
        print("reverted __init__.__version__ back to {}"
              .format(self.init_version))