One thing leads to another. Your code worked. Now I have additional questions. When I restore GMF to A as I did origianlly using SSMS, shouldn't I be changing the Name From GMF to A? How do I do that in SSMS?
You can't change the logical name of the database while doing restore, Because the backup files has all the header details like logical name and version ect....
http://sqlserverblogforum.blogspot.com/2011/01/step-by-step-restore-using-t-sql.html
If you want you can alter the DB after the restore finished.