Roll dough into four 18-inch-long ropes. Twist each rope into a pretzel shape and place on a parchment paper-lined baking sheet. Cover with a clean kitchen towel and let rise until doubled in size, about 25 minutes. Brush with beaten egg; sprinkle with salt or rosemary. Bake at 400 degrees until golden-brown, about 20 minutes. Let cool for 15 minutes.