In English grammar, subject-auxiliary inversion is the movement of an auxiliary verb to a position in front of the subject of a main clause. Also called subject-operator inversion.
The location of a finite auxiliary (or helping verb) to the left of the subject is called sentence-initial position.
Subject-auxiliary inversion occurs commonly (but not exclusively) in the formation of yes-no questions (e.g., You are hungry → Are you hungry?
Subject-auxiliary inversion also occurs commonly with wh-questions (Mary is singing → What is Mary singing?).
Examples:
Could you bring that to me?
Only afterwards had I realized that my wallet was missing.
Seldom does she leave home without her cellphone.
Had we been on that bus, we may have been involved in the crash.