Well, there are a couple of tricks you can do.
The typical way is to use the built in DLQ functionality and let your rolled-back messages head to DLQ. Then you can have whatever procedure trying to handle these messages afterwards.
But if you really want to keep the rolled back messages on the queue "as-is" and not touched by the consumer more than once, it can also be achieved.
First. Set max redeliveres to one, i.e. message will be retried one time.
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
RedeliveryPolicy policy = new RedeliveryPolicy();
policy.setMaximumRedeliveries(1);
cf.setRedeliveryPolicy(policy);
Then make sure to only receive non redelivered messages with a selector.
MessageConsumer cons = sess.createConsumer(sess.createQueue("FOOBAR"), "JMSRedelivered <> true");
To read the rolled back messages you would have to read with the reversed selector. Regardless, I still recommend using a separate queue for the rolled back messages, such as the built in DLQ. Much easier to deal with and less error prone.