How do I reverse engineer a recipe?
Look at similar recipes on the internet and tweak ingredients to match what you want. 

A lot of it is intuition from experience cooking and tasting a variety of dishes.  Also, a willingness to experiment is important.  You're not going the nail the recipe perfectly the first time.

Knowing the cuisine of a restaurant and typical ingredients and techniques of that cuisine can help. If you don't know much about the cuisine, google example recipes for that cuisine.  Keep an eye out for common techniques and flavor combinations. If you're looking for a certain sauce, again look to similar recipes from the same cuisine as the restaurant and swap in herbs, different wine, etc as necessary.

For a specific, well-known dish, look at several recipes for the same dish. You can usually tell which ones have been simplified or had more commonly available ingredients swapped in, and which ones are the original.

For ratios, intuition helps. For stuff like pasta to topping ratios, you can kinda guess based on what you want your finished dish to look like. For spices and the like, look at other recipes from the same cuisine for a starting point and then tweak to taste as you iterate your recipe. 

You should also learn how to adjust sauces by adding salt, acid (vinegar, lemon, lime), and possibly sugar.  In the Zuni cookbook, Judy Rogers suggests experimenting by tweaking a little bit of the sauce on a spoon to see if your change will work, before adding anything to the pan.

And finally, remember you don't really want to exactly reproduce the recipes in the restaurant.  You want to make something similar, but make it your own and make it better.  One of the great things about cooking at home is that you get to tweak things to exactly match your tastes and preferences.

Example:

I had a dessert with rosemary ice cream at a local restaurant. At the time, there were no rosemary ice cream recipes on the internet. But I found an infused ice cream (basil) in a cookbook and looked at the technique (infuse cream and strain, make custard base with it).  I replaced basil with a little rosemary, tasted it after infusing to see if I needed more (it was fine) and then proceeded with the rest of the recipe.  (The original was paired with tarte tatin, I paired mine with an apple cake.)