The X-ray polarization observations, made possible with the Imaging X-ray Polarimetry Explorer (IXPE), offer new ways of probing high-energy emission processes in astrophysical jets from blazars. Here, we report the first X-ray polarization observation of the blazar S4 0954+65 in a high optical and X-ray state. During our multi-wavelength (MWL) campaign of the source, we detected an optical flare whose peak coincided with the peak of an X-ray flare. This optical-X-ray flare most likely took place in a feature moving along the parsec-scale jet, imaged at 43 GHz by the Very Long Baseline Array (VLBA). The 43 GHz polarization angle of the moving component underwent a rotation near the time of the flare. In the optical band, prior to the IXPE observation, we measured the polarization angle to be aligned with the jet axis. In contrast, during the optical flare, the optical polarization angle was perpendicular to the jet axis; after the flare, it reverted to being parallel to the jet axis. Due to the smooth behavior of the optical polarization angle during the flare, we favor shocks as the main acceleration mechanism. We also infer that the ambient magnetic field lines in the jet were parallel to the jet position angle. The average degree of optical polarization during the IXPE observation was (14.3 ± 4.1)%. Despite the flare, we only detected an upper limit of 14% (at 3σ level) on the X-ray polarization degree; however, a reasonable assumption on the X-ray polarization angle results in an upper limit of 8.8% (3σ). We modeled the spectral energy distribution (SED) and spectral polarization distribution (SPD) of S4 0954+65 with leptonic (synchrotron self-Compton) and hadronic (proton and pair synchrotron) models. Our combined MWL polarization observations and SED modeling tentatively disfavor the use of hadronic models for the X-ray emission in S4 0954+65.