Things that don't follow a straight or logical path are nonlinear. In books and movies, a nonlinear narrative jumps around in time, rather than moving forward chronologically.
The word nonlinear means "not like a line," from the Latin linea, "string or line." Use this adjective to describe things that veer off the straight and narrow, or for situations in which one event doesn't clearly follow another. If you tell your friend the long story of how you first got your dog, interspersing the tale with details of the dream you had last night, that's a good example of a nonlinear narrative.