When someone removes an invoice all the lines and payments are removed with it. The thing would be to write a command to restore the invoice and the removed data. Something like:
rake siwapp:invoices:restore[14,15395]
Where 14 is the series_id and 15395 is the invoice number.