Drizzle olive oil to cover the surface of a wide and shallow pan. Add the sliced onions, reserving tender green leaves. Saute over low heat, stirring frequently, until onions reduce in size and become brown and caramel-y, about two hours. During the last 30 minutes of cooking, add the anchovy filet (if using,) smash the garlic cloves, and add the reserved tender leaves and stir to combine. Season with salt and pepper and let cool slightly.