To move an invoice from one deal to another, go to Contracts on the Customer tab.
Find the customer with the invoice to be moved, then click the arrow next to the customer name.
Click on the double arrow (right of the eye/view icon, before the invoice name) - see screenshot below.
This will open up a window to allow you to move the invoice to a different deal in your CRM system (HubSpot, Salesforce, or Pipedrive).