I believe the answer is: withdraws before the crime is complete.
By doing this, that person basically put his/her own position as a witness rather than the criminals.
But, the prosecutor could still has the ground to charge the person with the basis that he/she sure that a crime is about to happen but still does not report it to the police/