In case of you want to restore an database.
There are many ways to do so.
See link on Stackoverflow
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