In case of you want to restore an database.
There are many ways to do so.
See link on Stackoverflow
http://stackoverflow.com/questions/11620/how-do-you-kill-all-current-connections-to-a-sql-server-2005-database
Or there is another simple way:
1. In SQL Server studio, click Activity Monitor button
2. Filter by database
3. Right click to kill all of connection to that database