With a large spatula, press the hash into an even layer. With the back of a spoon, press four 1-inch deep wells into the sweet potato mixture. Crack an egg into each well and season with salt and pepper, if desired. Cover skillet and cook until eggs are set, about 5 minutes for soft-set. Garnish with green onions, if desired.