Evolution of localized electron spin in a nuclear spin environment