The guidance for the recycle bin https://docs.moodle.org/39/en/Recycle_bin explains how courses can be recovered by visiting the category they were in and using the recycle bin option.
Is there a way to recover deleted courses when the category they are in has also been deleted?