The Enterprise-E entering a temporal vortex in Star Trek 8: First Contact
Time travel is a plot device used in 4 movies in the Star Trek franchise. Specifically, Star Trek 4: The Voyage Home, Star Trek 7: Generations, Star Trek 8: First Contact and Star Trek (2009). This plot device is often used to change a cause-effect ripple created by a villain. Often in most cases, it serves to expose the characters to intolerable environment which seems alien to them. This usually creates character-effects that usually are not native to the character. This plot device is said to be an "excuse" by Star Trek writers to change character personae.