01 - Preheat oven to 400°F. Line a baking tray with parchment paper.
02 - Heat olive oil in a skillet over medium heat. Add chopped onion and cook until softened, about 3 minutes. Stir in minced garlic and cook for 30 seconds.
03 - Add spinach to the skillet; if using fresh, cook until wilted. For thawed spinach, heat until warmed through. Remove excess moisture by pressing the mixture with a spoon or draining in a sieve. Allow to cool slightly.
04 - Combine the cooled spinach mixture with crumbled feta, ground nutmeg, salt, and pepper. Mix thoroughly to incorporate.
05 - Unroll puff pastry onto a lightly floured surface. Spread the spinach-feta filling evenly over half the pastry, leaving a narrow border. Fold the pastry in half to cover the filling, pressing gently to seal.
06 - Slice the filled pastry into 12 strips, each approximately 3/4 inch wide. Twist each strip gently and arrange on the prepared baking tray.
07 - Brush each twist with beaten egg. Sprinkle with sesame or nigella seeds if desired. Bake for 18 to 20 minutes, or until puffed, golden, and crisp. Let cool slightly before serving.