CRM 4.0 doesn't support the undelete / restore function, once you delete the record, it marks it as deleted and delete it physically in the next sweep.
CRM supports Activate/ De-activate to cover this but I faced a requirements regarding this, having a recycle bin in CRM 4.0 for the deleted and still in the DB records,
so said why not, let's have it.
please find the first trial on code plex soon it is under this link: http://crmrecycle.codeplex.com/