How to recover a database log in SQL Server

We can use the RESTORE and WITH RECOVERY statements in SQL to recover a database log in SQL Server.

The following syntax recovers from a BACK file to SampleDB.

RESTORE LOG SampleDB
FROM DISK = 'E:\SQLBackups\SampleDBbackup.BAK'
WITH RECOVERY