Collect yourself, and then tell us which make / model router that you're talking about.
Many, though not all, name-brand routers have an emergency "recovery mode" that you can trigger.
I know Asus RT-N12/D1 and AC68U/R do, and Netgear WNR2000v2 does.