Is it possible to depalletize an object then palletize it back into its original position before moving on to the next object?

In this scenario, I am trying to program it to depalletize a bottle, move it to a position, then palletize it back into its original position before continuing to depallet the bottles.

Is this possible to program? If so, could anyone give me a little guidance?

Thanks in advance.