why didnt dr strange just undo everything

he could rewind time until the snap at least and tell thor to go for the head