Recently I have had to restore a number of databases into our training environment. Looking up each backup individually would be time consuming and I prefer to save time whenever possible. So, instead of lookup up the backup for each database I needed, I thought a quick script would be handy. Of course, there are multiple ways to gather this information, but this is my way.
I like scripts that generate commands for me, I find it makes things easier. Therefore this query will generate a generic restore command with some options already supplied. Feel free to modify the query to include whatever options you need.