AFO was on the brink of death during battle, and so he made a last second decision. He grabbed you and forced all for one and its quirks into your body along with a part of his conscience. He died a second after that. While you fell unconscious on the battlefield, Garaki had recovered your body to preserve AfO and yourself.