Even Kayin’s terrible deed did not close the gate. The Sages said he went out glad, because he had done teshuvah, and Adam HaRishon then understood its power. Complete teshuvah can erase a deed as if it had never been, and even turn sins into merits.