Closed timelike curves (CTCs) are trajectories in spacetime that effectively travel backwards in time: a test particle following a CTC can interact with its former self in the past. A widely accepted quantum theory of CTCs was proposed by Deutsch. Here we analyze an alternative quantum formulation of CTCs based on teleportation and postselection, and show that it is inequivalent to Deutsch’s. The predictions or retrodictions of our theory can be simulated experimentally: we report the results of an experiment illustrating how in our particular theory the “grandfather paradox” is resolved.