Subject-verb inversion occurs in questions and in initial negative adverbials, including those that are only partially negative like 'little' and 'hardly', and after initial "only" phrases. If there is no auxiliary verb to do the inversion with, you add a form of do before inverting. Never has he done that before.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.