As Gail says "no commit, no dice" 😉
it's also worth noting if the database is in simple or bulk-logged recovery the create\alter index is not fully logged!
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉