In literature, if foreshadowing is reference to future events, what would it be called if it is referencing a past event which the reader does not know?
Narratology uses the terms prolepsis and analepsis to refer to two types of discrepancies between the order in which events are told and the order presented in the plot.
Prolepsis refers to a so-called "flash-forward by which a future event is related as an interruption to the 'present' time of the narration" (Baldick, page 205).
Cuddon gives the following example from stanza 27 of Keats's Isabella (emphasis added):
So the two brothers and their murder'd man
Rode past fair Florence, to where Arno's stream
Gurgles through straiten'd banks
Analepsis refers to a chronological discrepancy "by which some of the events of a story are related at a point in the narrative after later story-events have already been recounted". This is often referred to as retrospection or flashback.
Gérard Genette distinguishes homodiegetic and heterodiegetic analepsis or prolepsis, depending on whether the chronological discrepancy concerns something in the narrative's primary foreground or not (quoted from Herman & Vervaeck):
If the analepsis or prolepsis concernt the element in the foreground of the primary narrative, Genette calls them homodiegetic. For instance, if a dying man remembers a moment from his own life, this would constitute a homodiegetic analepsis. If, however, he remembers something about a person who does not appear or has only a minor role in the primary narrative, then the analepsis is heterodiegetic.
- Baldick, Chris: The Concise Oxford Dictionary of Literary Terms. Second edition. Oxford University Press, 2001.
- Cuddon, J. A.: The Penguin Dictionary of Literary Terms and Literary Theory. Third edition. Penguin 1992.
- Herman, Luc; Vervaeck, Bart: Handbook of Narrative Analysis. University of Nebraska Press, 2005. (Translation from the Dutch Vertelduivels. Handboek verhaalanalyse. Vantilt, 2005.)
Foreshadowing is not necessarily reference to future events.
A foreshadowing is a reference to events which will be revealed later in the story. They're in the future from the point of view of the reader, but not necessarily events which are in the future "in-universe".
Foreshadowing is a literary device in which a writer gives an advance hint of what is to come later in the story.
(It should be noted that neither of the sources linked above are very good. I'm not sure what's a better dictionary of literary devices, but would be very happy to be directed to one.)
In this context, "later in the story" means later in the physical book or otherwise in the telling of the narrative - not necessarily events which actually occurred later within the world of the story. For some examples of foreshadowing of earlier events, in a somewhat famous work of modern literature, see this Q&A:
"I wouldn’t mind knowing how Riddle got an award for special services to Hogwarts either."
"Could’ve been anything," said Ron. "Maybe he got thirty O.W.L.s or saved a teacher from the giant squid. Maybe he murdered Myrtle; that would’ve done everyone a favour..."
-- Harry Potter, book 2, chapter 13
It's revealed later in this book that Riddle did in fact murder Myrtle, several decades earlier. The event being foreshadowed is well in the past, and only the revelation of it is in the future.
"Dumbledore believed Snape was sorry James was dead? Snape hated James..."
"And he didn't think my mother was worth a damn either," said Harry, "because she was Muggle-born...'Mudblood,' he called her..."
-- Harry Potter, book 6, chapter 29
It's revealed in the next book that Snape's "Mudblood" outburst was out of character, and in fact he not only didn't hate Lily (Harry's mother) but had in fact been in love with her since childhood. Here Snape's love for Lily is a continuing state through the past, present, and future ("After all this time?" "Always."), but there's foreshadowing because the revelation of it is in the future.
So to answer your question:
what would it be called if it is referencing a past event which the reader does not know?
This is still foreshadowing. If the reader doesn't know but will find out later, then the revelation is in the future and it's foreshadowing, regardless of whether the event being referenced is in the future or the past.