The auxiliary verbs do, does and did are followed by the bare infinitive to form negative and interrogative sentences in the past simple and present simple tenses:
When only after, only if, only in this way etc. are placed at the beginning of the sentence for rhetorical effect, the subject and auxiliary are inverted: