def replace_underscores(text: str) -> str:
    """
    Replace escaped underscores in a text.

    :return: the processed text
    """
    text_a = text.replace("\\_\\_", "`__`")
    text_b = text_a.replace("\\_", "`_`")
    return text_b