Also, you can use the sp_who2 proc to see IF another user has a connection to the DB.
You can either kill xxx (where xxx is the SPID of the user connected to the DB) OR I use the following script and un-comment the ALTER DATABASE statement to place the DB in single user mode to kick out any users then do the restore (you will have to fill in the correct paths/names etc...):
USE master
RESTORE FILELISTONLY
FROM DISK = '' --Disk Backup File
--sp_helpdb TEST
USE master
--ALTER DATABASE [TEST] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE [TEST] -- DB Name
FROM DISK = '' --Disk Backup File
WITH STATS, REPLACE,
MOVE '' TO '.mdf',
MOVE '' TO '.ldf'