This is exactly what QueueImpl::cancel does.
If you look at ServerConsumerImpl::cancelRefs, you will see it cancelling every received reference, that method is called during close and rollback.
You would need to add a new method cancelRef(... don't know what parameter yet).
You would need to treat if the reference really belongs to the consumer. As you can't NACK a reference you didn't receive before.