def pybtex_unescape(string: str) -> str:
    """
    Reverts the escaping applied by Pybtex.

    :param str: Input string with pybtex-escape characters.
    :return: Output string where this has been reverted.
    """
    return string.replace('\\_', '_').replace('\\textasciitilde ', '~')