Heat the oven to 400°F and arrange a rack in the middle.
Using your hands, rub the tenderloin all over with the oil and garlic, sprinkle with the thyme leaves, salt and pepper, and rub until evenly coated; set aside.
Heat a large frying pan over medium-high heat until just starting to smoke. Place the beef in the pan and sear, turning occasionally, until golden brown all over, about 10 minutes.
In a baking dish, put a tablespoon of oil on the bottom, then add the onions then the potatoes, season well with salt and pepper.
Roast until an instant-read thermometer inserted into the thickest part of the beef registers 120°F to 125°F for rare or 125°F to 135°F for medium rare, about 20 to 30 minutes.
Transfer the beef to a cutting board and tent it loosely with foil. Let it rest at least 20 minutes before slicing.