Correcting functionals

So due to some miscommunication with the scanner techs, there is a slight hiccup with a functional dataset. The scanner wasn’t centering the image in the frequency space, and as a result the slices appear with some, or no, random shift in the Z plane. I can’t imagine I am the first person to have done this, and am wondering if there is a function or tool that can be used to undo the phase shift applied to the functional images so that they are all aligned with respect to each other. It’s a 2D shift along only one axis, and looking over the math for FFT and shifts it seems like it should be a reversible effect, but I thought I would check to see if anyone else has already made a solution to this problem. Thank you for your time.