How to reset camera to original rotation after its CFrame rotation was changed?

In other words, how do I achieve a CameraOffset, but with rotation instead of position?

I have a camera bobbing script that changes the rotation of the camera.

xOffset = sin(os.clock()) (These functions are placeholders)
zOffset = sin(os.clock())
bobCFrame = bobCFrame:Lerp(CFrame.Angles(xOffset,0,zOffset),0.5*deltaTime)

cam.CFrame = cam.CFrame * bobCFrame

However, when I change bobCFrame to CFrame.new, the camera’s rotation just stays where it is. I need it to go back to the rotation that it was like before it was altered, similar to how CameraOffset works. I have a vague idea that I could subtract the changed offsets from the camera’s CFrame, but I don’t know how I could do that or where to start.

Try this:

local originalRotation = cam.CFrame
xOffset = sin(os.clock()) (These functions are placeholders)
zOffset = sin(os.clock())
bobCFrame = bobCFrame:Lerp(CFrame.Angles(xOffset,0,zOffset),0.5*deltaTime)

cam.CFrame = cam.CFrame * bobCFrame
cam.CFrame = originalRotation