You invert an interval when you move the lowest tone of an interval one octave higher or the highest tone one octave lower. The general name changes this way:
Second becomes seventh.
Third becomes sixth.
Forth becomes fifth.
Fifth becomes fourth.
Sixth becomes third.
Seventh becomes second.
The specific name changes this way:
Diminished becomes augmented.
Minor becomes major.
Perfect stays perfect.
Major becomes minor.
Augmented becomes diminished.
Below are two examples, a major third is inverted and becomes a minor sixth, and a minor seventh is inverted and becomes a major second.