Neither of those solutions solve the revving. You either have a vaccum leak, or you have a gunked up EACV or Cold idle valve. You could also have a bad gasket on yout TB or intake manifold. To solve the problem permanently, you have to eliminate the cause. Resetting the ecu MAY get rid of it for a few days, maybe even moneths, but it will come back. Track down the leak, and you're good to go.