Apply a refund check to an outstanding credit

Apply a refund check to an outstanding credit that has part of it applied to a previous invoice. For ex. total credit of $5,000, we applied $1000 of that $5000 to an invoice, and then the company sent us a refund check for $4,000. Now, I want to apply the check to the remaining $4,000 cr in FE. How do I do that?