SQL Server auto restore only log where not restored before
I assume that your database is in the restoring state and you alredy have restored a full backupset WITH NORECOVERY.

In this case you can inspect the contents of the log backups using RESTORE HEADERONLY: this will return the column FirstLSN, that you can use to compare with MAX(redo_start_lsn) from sys.master_files.
All log backups with FisrtLSN &lt; MAX(redo_start_lsn) can be safely skipped.