I can't answer whether it is removed from your record if they choose to rehire you, but it seems like something that would stay on your record, and would probably get in the way of any attempt to promote. Regardless, it hurts nothing to just apply.
I see way too many people make this kind of mistake, NCNS during their two weeks, quitting on the spot, etc, thinking they're moving on and wont want/need to come back. Then things change, they need a job, and try to come back and can't. Too many people lack the scope to be careful about not burning bridges behind them. I've actually turned down jobs that wanted me to quit a current job without notice so I could start with them immediately. I always try to leave that door open behind me, just in case, and I think its something everyone should do.