QuickBooks Online is designed to keep you as organized as possible, and that includes ditching the shoebox full of receipts. It's awesome that you're taking advantage of storing digital copies in your account. I know how important it is to add the attachments to the proper transactions, and I'd be happy to explain how to change the attachment from one transaction to another.
The first step will be to remove the attachment from the first transaction. To do that, open the transaction and scroll down until you see the attachment, then click the small "x" next to it.