It could have been a sip of bad gas. If it keeps on happening then you need to work on your idle speed -- you could do a
search on this often-discussed subject.
As a temporary solution, you could shift into neutral if it happens again, and give it some gas.