Reset the environment to its state before it was frozen by :func:`freeze`.

    :param str label: The name for the frozen environment.
    :param bool pop: Destroy the freeze after use; only allow unfreeze once.
    :param dict environ: The environment to work on; defaults to ``os.environ``.
    :returns: A context manager to re-freeze the environment on exit.

    Usage::

        unfreeze('nuke')

        # or

        with unfreeze('maya'):
            # do something

def unfreeze(label, pop=False, environ=None):
    """Reset the environment to its state before it was frozen by :func:`freeze`.

    :param str label: The name for the frozen environment.
    :param bool pop: Destroy the freeze after use; only allow unfreeze once.
    :param dict environ: The environment to work on; defaults to ``os.environ``.
    :returns: A context manager to re-freeze the environment on exit.

    Usage::

        unfreeze('nuke')

        # or

        with unfreeze('maya'):
            # do something

    """

    environ = os.environ if environ is None else environ
    diff = _get_diff(environ, label, pop=pop)
    original = _apply_diff(environ, diff)
    return _refreezer(environ, diff, original)