Demotion
A demotion was when an individual within a military or other hierarchical structure was given a reduction of rank or position by a commanding officer. A demotion was by definition the opposite of a promotion.

Punitive cases 
In most cases, a demotion was a form of punishment for a failure to follow orders or other forms of gross negligence, short of a court martial. 

After his less-than-impressive dealings with the Nausicaans in 2151, First Officer Matthew Ryan of the Earth Cargo Service freighter  was demoted to able crewman in order to have to earn back Captain Keene's trust. ()

The same year, Commander  threatened Lieutenant Malcolm Reed that he was going to "bust your ass back to crewman second class for insubordination," though Reed countered, "Be my guest. I could use a little less responsibility." () 

The next year, Captain Jonathan Archer gave Reed the same warning, heeding that, "If I were the kind of captain you think I should be, I'd bust your ass back to crewman," after Reed had tried to disconnect his EV suit's air supply. () 

In 2259 of the alternate reality,  was demoted from captain to the rank of commander after he had violated the Prime Directive on the planet Nibiru. Later, Kirk was assigned as first officer of the  under Captain . ()

In 2266, Decius was demoted two steps in rank by his commanding officer for sending an unauthorized transmission to the praetor on Romulus. ()

In 2269, Janice Lester (posing as James T. Kirk) and Leonard McCoy discussed the service record of Arthur Coleman, who had lost his post as chief medical officer. Lester told McCoy that promotions and demotions were subject to political maneuvering, but McCoy stated this wasn't the case either at Starfleet Headquarters or the Surgeon General's office. ()

In 2286, Rear Admiral Kirk was demoted to captain by the Federation Council for disobeying a direct order from the Commander, Starfleet, Morrow. (; )

Following an incident on Garon II in the 2360s, Ro Laren was demoted to ensign. Several years later, in 2368, Captain Jean-Luc Picard thought she would have made lieutenant commander by that time, if not for her actions. ()

In 2372, Dukat was demoted from chief military advisor of the Detapa Council to a position commanding the Cardassian military freighter Groumall. Dukat later thought about demoting his rival Gul Marratt and assigning him to the Cardassian embassy on , when it seemed Dukat could return to power. ()

In 2374, when Damar was manning the security office on Deep Space 9 instead of Odo, Major Kira Nerys sarcastically asked him if Dukat had demoted him to security detail. ()

The same year, Seven of Nine reassigned Harry Kim to chamber maintenance and gave him the new designation Two of Ten, essentially demoting him. When Kim protested, Seven claimed this was a useful Starfleet protocol she had adapted. ()

In 2375, Tom Paris was demoted from lieutenant junior grade to ensign for disobeying orders by Captain Kathryn Janeway. ()

The following year,  mistakenly informed his superiors that The Doctor was in command of the . Fearing demotion, he asked the Voyager to maintain that illusion to a number of Hierarchy  vessels. ()

Prior to 2380, Beckett Mariner held a higher rank, but her disregard for Starfleet's bureaucracy lead her to being demoted back down to ensign. ()

Commander Michael Burnham was stripped of all rank for the charge of mutiny (). Her rank was later restored (). She was promoted to First Officer (), but was stripped of this role for disobeying a direct order , although her rank was not reduced. ()

In an alternate timeline 2404, Captain Harry Kim worried that Starfleet Command would demote him back to ensign once they learned about him and Kathryn Janeway attempting to alter the timeline. ()

Non-punitive cases 
In other cases, a reduction in rank or responsibility could be given to an officer as a non-punitive formality, or as a political move. 

In the early 2270s, Rear Admiral James T. Kirk replaced Captain Will Decker as the commanding officer of the . This resulted in Kirk receiving a temporary grade reduction from rear admiral to captain. Kirk, in turn, gave Decker a temporary grade reduction to commander and had him stay on as the ship's executive officer. ()

Commander William T. Riker was granted a field commission to captain of the  following the capture of Captain Jean-Luc Picard by the Borg in 2366. After the return of Picard to the Enterprise, Riker resumed his role as first officer and returned to his previous rank of commander. () 

Late in the Dominion War in 2375, General Martok was honored by Chancellor Gowron with the Star of Kahless, who described the general as "the most famous warrior in the Empire." Following the ceremony, Gowron took over Martok's command with the preface that "I can't ask you to carry this weight forever. It's time for me to take a more active role in this war," before announcing that "I'm assuming direct command of our forces." Gowron sugar-coated the demotion by telling Martok to "Be happy. You're a warrior again. No more meetings, no more reports to file. You'll be out there, savoring the heat of battle. I envy you." In reality, according to Worf, this was a political move made by the chancellor because he wished to be the savior of the Empire himself. ()

In 2381, after a Transporter accident lead to a Transporter duplicate of Lieutenant junior grade Bradward Boimler being created, Riker, now captain of the , told the two that Starfleet forbade clones from working on the same ship and that one of them had to return to the  with a demotion back to Ensign. The duplicate tricked Boimler into taking the demotion, sending him back to his former ship and rank.()

In 2399, retired Starfleet admiral Jean-Luc Picard made a request to Fleet admiral Kirsten Clancy that she temporarily reinstate him for one mission. In his appeal, he said that he would "be content with being demoted to Captain." This did not come to pass, however, as the Flag officer angrily denied Picard's request. ()

See also
Discommendation
Formal reprimand
Promotion
Stripped of rank

External links 

 
 
Punishments
Ceremonies