Hello and thank you for using Just Answer
if it happened after hitting a pot hole sounds like something may have come loose
check the air tube that runs from the air cleaner to the throttle body to make sure it is tight and has no cracks.
the Mass Air Flow Sensor is also sensitive to this type of shock
when the engine light comes on a code is set .. you can bring it to a parts store like Autozone and they will read the code for free.
this code will help to diagnose the problem
but it sounds like either your air tube came loose or your Mass Air Meter is acting up
let me know what you find and if you need more help