A) touches an offensive player before the snap, the play is dead, defensive offsides.
B) an offensive player near the defender reacts and false starts, the play is dead, defensive offsides.
C) ball is snapped while the defender is offsides, but neither A or B has happened then play continues but a flag is thrown
D) ball is snapped but the defender has a clear path to the QB aided by his being offsides, play is dead, defensive offsides.
If non of the above happens and the defender returns to an onsides position before the snap, there is no penalty.