I've been told that flies take off backwards, but I haven't really been able to prove it to myself. The closest I've gotten was noticing that they fly into window glass back-first, with their heads pointing up. Is that how they take off?
A 2008 study on fruit flies found that when faced with an immediate threat, flies would tend to launch themselves into the air in the opposite direction to the threat. So when confronted by a threat from directly ahead, the flies would jump backwards.
Interestingly, "in response to stimuli approaching from the side, however, flies jumped at an angle that was approximately halfway between directly away and directly forward." In other words, the response was biased toward taking off in the forward direction.
The study's authors note that "voluntary takeoffs elicited by either attractive odors or internal cues are almost always in the forward direction".
To summarize, fruit flies will take off in a forward direction when possible, but can take off backwards or at an angle when faced with an immediate threat.
- Card, Gwyneth; Dickinson, Michael H. (September 9, 2008). "Visually mediated motor planning in the escape response of Drosophila". Current Biology 18: 1300–1307. doi:10.1016/j.cub.2008.07.094.
From this video demonstration in caltech, you can clearly see that Drosophila can fly forwards as well as backwards using high fps video image capture and it even does unexpected behaviours in times of perceived danger/threat.