Powerful relativistic jets are one of the main ways in which accreting black holes provide kinetic feedback to their surroundings. Jets launched from or redirected by the accretion flow that powers them are expected to be affected by the dynamics of the flow, which for accreting stellar-mass black holes has shown evidence for precession1 due to frame-dragging effects that occur when the black-hole spin axis is misaligned with the orbital plane of its companion star2. Recently, theoretical simulations have suggested that the jets can exert an additional torque on the accretion flow3, although the interplay between the dynamics of the accretion flow and the launching of the jets is not yet understood. Here we report a rapidly changing jet orientation-on a time scale of minutes to hours-in the black-hole X-ray binary V404 Cygni, detected with very-long-baseline interferometry during the peak of its 2015 outburst. We show that this changing jet orientation can be modelled as the Lense-Thirring precession of a vertically extended slim disk that arises from the super-Eddington accretion rate4. Our findings suggest that the dynamics of the precessing inner accretion disk could play a role in either directly launching or redirecting the jets within the inner few hundred gravitational radii. Similar dynamics should be expected in any strongly accreting black hole whose spin is misaligned with the inflowing gas, both affecting the observational characteristics of the jets and distributing the black-hole feedback more uniformly over the surrounding environment5,6.