Restoring soft-deleted instances

If you have soft-deleted an instance of a model with paranoid: true, and would like to undo the deletion, use the restore method:

  1. Task.create({ title: 'a task' }).then(task => {
  2. // now you see me...
  3. return task.destroy();
  4. }).then((task) => {
  5. // now i'm gone, but wait...
  6. return task.restore();
  7. })