function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dennis H PalmerDennis H Palmer 

recover deleted apex class

Why is there no way to recover deleted Apex Triggers/Classes/VF Pages?
Raj VakatiRaj Vakati
Currently, it is not possible to recover a deleted triggers or classes. However, you can retrieve the deleted class or trigger id from workbench using the following SOQL query:
 
Select Id,Name from ApexTrigger where status='deleted' or name='classname'

After getting the Id, you may try to browse to the following URL: https://<instance>.salesforce.com/<trigger-or-class-id> to see if the code of the trigger/class is still accessible.

NOTE: If you get "Data not available", the deleted trigger/class is no longer accessible.
Raj VakatiRaj Vakati
https://help.salesforce.com/articleView?id=000181984&language=en_US&type=1