The software either knows, or does not know, if there are unsaved changes. That is a yes/no question. So it is either monitoring whether the document is "dirty" (programming jargon for "has unsaved changes") or it is not.
OMITTING THE ARTICLE
Leaving this page will discard unsaved changes.
USING "ANY" INSTEAD OF THE ARTICLE
Leaving this page will discard any unsaved changes.
USING THE DEFINITE ARTICLE
Leaving this page will discard the unsaved changes.
To use the definite article the implies that there are in fact unsaved changes to be concerned about, and so there had better be, or the user can lose faith in the software. So a software developer should use the only if the software is actually monitoring the document for changes (and the document is "dirty").
To use any will never be inaccurate, since it implies that there may be such unsaved changes. But to use any explicitly reminds the user every time the warning is displayed that the software is not "intelligent" enough to detect if there are such unsaved changes. So the people in the sales department would advise against any. Why remind the user of a shortcoming?
When neither the definite article the nor any is used, the warning becomes a general truth (unsaved changes do not get saved if you exit now), which leaves it up to the user to decide if there are such changes to be concerned about. This is little different than using any; but it lacks the explicit reminder of the software's shortcoming. This is the version the sales department would opt for when the software lacked the intelligence to track the document's state.