For both discards and topdeckings, the order the cards are clicked is the order they are done.
That means if you are attacked by a Militia or similar card, the last card clicked will be the last card discarded (the one visible to your opponent(s) in game and mentioned in the log=.
For Ghost Ship that means the last card clicked will end up on top of your draw pile, the one clicked second to last will end up below that, a.s.o.
There is no place in the game where this is explained to players
, which unfortunately makes this question come up every once in a while.