If a customer uses gift card to pay for an order and later if that order is cancelled, will the gift card gets credited back (automatically) with that amount?

because i tried in test environment, and gift card was with 0 value as whole amount was used up in that orser (which was cancelled later and refunded).

Do we have to manually credit back the amount in gift card?