Let's say you enroll a student in the wrong class and the invoice was created, e.g. you can't just delete the item from the shop cart. Could be the wrong time period, could be just the wrong class.
1. If you have not received a payment, just drop the student. Easy. Then enroll the student in the new class.
2. If you have received a payment against the wrong class, then simply Transfer the student to the new class. You can issue a full credit and then apply the credit.
3. What if you already enrolled the student in the new class? There is one wrong enrollment and one good enrollment. You should drop the student in the wrong class, issue a full credit and then go to the invoice with the good enrollment and apply that credit.
Please don't just edit invoice items. This can affect the enrollment records, attendance, financials, you name it. Use the Drop and Transfer options to make these fixes.