I swear to do it tomorrow! is standard.
What about the prefect infinitive and gerunds?
1 I swear to have done it yesterday! - CORRECT?
2 I swear doing it yesterday! - CORRECT?
3 I swear having done it yesterday! - CORRECT?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.
Sign up to join this communityswear is basically a performative verb. That page explains them in more detail. performative verbs in the form of a declaration
More idiomatic for this performative meaning:
I swear I will do it tomorrow. [I raise my hand]
I swear I did it yesterday. [I raise my hand]
I swear (to you) that I have done it in the past. [undefined past, not performative]
The three samples in the question are basically ungrammatical.
"swear to" can be followed by a noun/pronoun:
I swore to him that I had done that.
OR, with a verb after to
No past infinitive after to:
I swore to having left at 6 o'clock. [no past infinitive]
I will swear to having left at 6 o'clock.
There are two different meanings of swear, that subcategorize for different grammatical arguments.
Swear meaning "strongly promise" takes either a to infinitive clause, or a finite that clause with explicit expression of intention:
I swear to give up smoking = I swear that I will give up smoking.
Swear meaning "strongly assert or affirm" normally takes a finite that clause, but can also take to with an -ing clause. The latter is rather literary or old-fashioned.
Your sample sentence has the first meaning, and so is as you say standard with the to infinitive.
Your three numbered sentences are all in the past, so cannot have the first meaning, and must have the second. None of them satisfy the conditions I've mentioned above, so all three are ungrammatical.