Earlier, I grouped a load of objects (some of which had been rotated around) together, which seemed to set their pivot point to the world origin (0, 0, 0). I have since separated the objects and want the pivot point of each to be exactly like they were before I made the group, i.e., centred and with the correct rotation.
I have tried resetting the pivot point, but this only puts it back in the right position, and the rotation of it still follows the world axes. I've included a screenshot with the Scale tool selected where you can see that the axes it brings up are off in relation to the way the object is rotated.

Does anyone know of a way of fixing this, or at least a workaround?
EDIT: I have already found a solution elsewhere: double click the rotate or scale tool to bring up settings, then press the second drop down arrow under Axis Orientation, press Set to Component and select the component.