Did you get this with the API?
If not, here are hints of how to do it in rails: Bulk un-deletion - #3 by pfaffman