def _backup_to_tag(pason, time):
    """Finds the last time that the bit tagged bottom before `time`
    
    Parameters
    ----------
    pason : PasonData
        A `:obj:PasonData` object
    time : datetime
        `:obj:datetime` object representing a time following a bottom tag.
    
    Returns
    -------
    datetime
        `:obj:datetime` object representing the time of the last bottom tag before `time`
    
    Raises
    ------
    UnexpectedData
        Raised if 'bit_depth' or 'hole_depth' aren't in `pason.data`

    """
    if ('bit_depth' not in pason.data.columns or 'hole_depth' not in pason.
        data.columns):
        raise ValueError(
            f'{pason.filename} must contain Bit Depth AND Hole Depths to find the last bottom tag!'
            )
    i = int((pason.data['yyyy/mm/dd_hh:mm:ss'] >= time).argmax())
    off_bottom = pason.data['hole_depth'].iloc[:i] - pason.data['bit_depth'
        ].iloc[:i]
    last_off_bottom_idx = int((off_bottom > 1)[::-1].idxmax())
    return pason.data['yyyy/mm/dd_hh:mm:ss'].iloc[last_off_bottom_idx]
