WRONG
It stores the code even though it still doesn't see the fault. Its called a soft code. The original fault has stopped so the light went off BUT it retains the code.
Now if it stalls like the goofed the clutch and stalled it the check engine light will come back on and then you wont have a code but if it threw a light for any other reason it should still have a code stored as long as power to the ECM has not been interrupted.
im not sure about that because i was having transmission problems to where my check engine light would come on here and there and right after it came on it went back off before i could pull over i pulled over and got out my lil scan tool i keep in my runner and nothign showed up i was confused i thought it kept the code to but for some reason it didnt show a code the only time i got it to show a code is when the light was actually on