Uncovering the origin of the arrow of time remains a fundamental scientific challenge. Within the framework of statistical physics, this problem was inextricably associated with the second law of thermodynamics, which declares that entropy growth proceeds from the systems entanglement with the environment. It remains to be seen, however, whether the irreversibility of time is a fundamental law of nature or whether, on the contrary, it might be circumvented. Here we show that, while in nature the complex conjugation needed for time reversal is exponentially improbable, one can design a quantum algorithm that includes complex conjugation and thus reverses a given quantum state. Using this algorithm on an IBM quantum computer enables us to experimentally demonstrate a backward time dynamics for an electron scattered on a two-level impurity.