After FK animation, a joint chain may flip to an undesired position when you enable the IK solver (Animate > IK/FK Keys > Enable IK Solver). To undo the joint flipping and prevent it from occurring when you turn on Enable IK Solver, do the following:
This returns the joint chain to the position it had before flipping.
Continue using IK as desired.