Using the following MWE, the direction of the blue arrow is opposite to the black one:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\draw [name path=base] (-1,-1) rectangle (1,1);
\draw [->, name path=line] (0.5,-2) -- (1.8,2);
\draw [color=blue, thick, ->, name intersections={of=line and base, sort by=line}] (intersection-1) -- (intersection-2);
\end{tikzpicture}
\end{document}
See https://github.com/pgf-tikz/pgf/issues/480