def inverse_z_score(X, std, mu=None):
    """
    Reverses z_score normalization using previously computed mu and sigma.

    Parameters:
        X' (np.array)[*, k]: The normalized data.
        sigma (np.array)[k, k]: The previously computed standard deviations.

    Keywords:
        mu (np.array)[k]: Optional, previously computed mean vector.

    Returns:
        X (np.array)[*, k]: The un-normalized data.
    """
    if mu is None:
        return std ** 2 * X
    else:
        return std * X + mu