If you never realized that you spoke an untruth (by mistake, of course), then ultimately it won't matter. However, after unintentionally speaking an untruth, and realizing it, later on, this kind of activity becomes a sin, which is to be expiated.
Manu Smriti 11.45
अकामतः कृते पापे प्रायश्चित्तं विदुर्बुधाः । कामकारकृतेऽप्याहुरेके
श्रुतिनिदर्शनात् ॥ ४५ ॥
The learned understand Expiatory rites to pertain to cases where the
sin is committed unintentionally; some people however assert on the
evidence of ‘Śruti texts’ that they apply to cases of intentional
offence also.—(45)
Medhatithi on the above says -
Committed unintentionally.’—They declare that Expiatory Rites are
meant, to be performed in cases where the ‘sin’—the transgression of
the ordinances—has been committed through negligence or want of care.
And so says the Devala Smriti
Devala Smriti
‘When a sin has been committed unintentionally, and only once, there
is expiation prescribed for it by persons versed in the Law. If the
sin is committed a second time, the penance shall he the double of the
former; if it is repeated for the third time, it shall he the
three-fold Kṛcchra; and for the fourth repetition, there is no
expiation. Nor is there any expiation for a sin committed even once,
if it has been committed intentionally. But some people lay down
expiation even for sins committed intentionally.’
So for unintentional acts, expiation can be done. Because after realizing their unintentional intent, they do count as a sin and thus Adharma.
Yājñavalkya (3.219-221).—
By the performance of expiatory penances does that sin disappear which had been committed unintentionally; if the sin had been
committed intentionally, the performance of the penances only makes
the man fit for being associated with; such being the declaration.
Those who commit sins, and yet do not perform the penances, nor repent their misdeeds, fall into terrible hells.’
So, as you ask
So here, unknowingly, I have said something untrue. In such a situation, have I done something Adharmic?
Since you realized that you lied, thus, it will count as a sin and thus Adharma, which has to be expiated, as per scriptures.
Edit:
In the Matsya Purāṇa, we get a list of situations where lying/speaking untruth might not be considered as a transgression of the Dharma
This is quoted by Sarmiṣṭhā (Devayānī's maid-servant) to King Yayāti
Chapter 32, Matsya Purāṇa
शर्मिष्ठोवाच।
न नर्मयुक्तं वचनं हिनस्ति न स्त्रीषु राजन्नविवाहकाले ।
प्राणात्यये
सर्वधनापहारे पञ्चानृतान्याहुरपातकानि ॥ ३१.१६ ॥
पृष्ठास्तु साक्ष्ये प्रवदन्ति चान्यथा भवन्ति मिथ्या वचना नरेन्द्र ते ।
एकार्थतायान्तु समाहितायां मिथ्या वदन्तं ह्यनृतं हिनस्ति ॥ ३१.१७ ॥
Sarmiṣṭhā said:—
- & 17. “O King! there is no sin in speaking untruth at the
time of indulging in sexual pleasures, on the occasion of marriage,
when life is in danger, wealth is at stake, and while joking. Lying on
these five occasions is venal. It is only a sin to speak an untruth at
the time of being summoned as a witness, or when one is entrusted to
the dispute of a thing, or when one is asked his advice on any point.”
So basis this, such kind of lying is considered forbidden because of its corrupt nature, but not a sin or an act of Adharma.
Although, we must be aware that this quote is coming from Sarmiṣṭhā, who at that point was clearly emotional & infatuated by, and desperate to have King Yayati, so one might construe that she might be making things up. But, fortunately, a similar verse is found in the Vāyu Purāṇa too, so that means Sarmiṣṭhā is quoting the right Dharma as per scriptures.
Chapter 18, Vāyu Purāṇa
न म(न)र्मयुक्तं वचनं हिनस्तीति मनीषिणः ।
तथाऽपि च न कर्तव्यः
प्रसङ्गो ह्येष दारुणः ॥ १० ॥
क्रीडा-परिहास के समय असत्य बोलने से कोई दोष नहीं होता है; - किन्तु ऐसा
नहीं करना चाहिये क्योकि ऐसा प्रसङ्ग ही भयङ्कर होता है । १० ।
- No harm or sin is incurred from lies or untruths spoken during playful
jest-dalliance; although, such behavior is not encouraged much on
account of its inappropriateness.
So basis the above two standalone verses from the two Purāṇas, we may conclude that at the very least, the example case cited by the OP in the question may not be considered Adharma, since no sin was committed in the first place.