  We study the Brownian dynamics of hard spheres under spatially inhomogeneous
shear, using event-driven Brownian dynamics simulations and power functional
theory. We examine density and current profiles both for steady states and for
the transient dynamics after switching on and switching off an external square
wave shear force field. We find that a dense hard sphere fluid (volume fraction
$\approx$0.35) undergoes global motion reversal after switching off the shear
force field. We use power functional theory with a spatially nonlocal memory
kernel to describe the superadiabatic force contributions and obtain good
quantitative agreement of the theoretical results with simulation data. The
theory provides an explanation for the motion reversal: Internal superadiabatic
nonequilibrium forces that oppose the externally driven current arise due to
memory after switching off. The effect is genuinely viscoelastic: in steady
state, viscous forces oppose the current, but they elastically generate an
opposing current after switch-off.

Soft Condensed Matter