How can I recreate a custom object after delete?

How do you get the ObjectId? Had you saved it? It looks you are using the wrong objectId