This is the command:
RESTORE DATABASE TestDatabase FROM DISK = 'C:\temp\MyBackup.bak'
WITH MOVE 'ProductionDatabase' TO '<somepath>\TestDatabase.mdf'.
MOVE 'ProductionDatabase_log' TO '<somepath>\TestDatabase.ldf'
Some notes:
The name that follow DISK =
is the path to the backup file. Replace with the actual backup.
The names that follow MOVE are the logical names of the files, and must agree with those in the backup. You can find them with this command:
RESTORE FILELISTONLY FROM DISK = 'C:\temp\Backup.bak'
The logical names are in the first column.
The names that follow TO are the file locations for the files of the new database. They can be anywhere, but you should make a judicious choice. Presumably they should be in the same path as other database. (You can find the locations of the files for an existing database with sp_helpdb.)
If you created an empty database called TestDatabase, drop it first. RESTORE will create a new database. If you keep the empty database, you will get an error as SQL Server thinks you may lose data if it would just wipe away the files for the existing database.
As for the dialogues in SSMS, I can't help much there since I never use them. But I recall that they are more confusing than helpful.