Restore master database is a must know task for any DBA. Master database is one of the key SQL Server database and should be a part of backup/maintenance plan. In case of issues, this is how it can be restored from a backup.
Start the SQL Server instance in single user mode from the command window as shown below
C:\>NET STOP SQLSERVERSERVICE
C:\>NET START SQLSERVERSERVICE /m
For more details refer to this link
Once you have your instance running in single user mode. Open a command prompt and connect to the SQL Instance via SQLCMD and then run the restore command as shown below.
The restore command is specified with REPLACE command so as to overwrite the existing master database. The SQL Server service is stopped once master database is restored. Start the service and you are good to go. I would suggest to practice it in test environment so that you are ready when it is required in production environment.