Surely your I-140 is still good. You need to fill out some form to change to consular process if you applied AOS initially. better consult some lawyer.