Video of a San Francisco police officer shooting an unarmed man in a heated confrontation shows that a second officer tried to subdue the man with baton blows moments earlier but was knocked to the ground.

The city’s public defender said the baton strikes were among actions that defied a high-profile push to get city police to focus on de-escalating potentially dangerous situations. But police officials said the officers, whose actions are under investigation, appeared to use “great restraint” in handling the encounter.

Public Defender Jeff Adachi released the footage from one of the officers’ body-worn cameras on Wednesday in a bid to have charges dropped against the man who was shot and wounded outside his front door in the Ocean View neighborhood, 43-year-old Sean Moore.

Police had declined to release the video — the first to capture a shooting since San Francisco gave officers the Taser Axon cameras last year — saying it might taint the investigation. But following Adachi’s news conference, they showed footage from both officers’ devices and said they had intended to release the video Thursday.

The back-and-forth suggested that the emergence of body-camera video of police shootings around the country may, while bringing some clarity, also yield dueling narratives about what the footage reveals.

The San Francisco video depicts an eight-minute encounter in the early morning of Jan. 6, which began when two officers responded to reports of a restraining-order violation.

It ends with Officer Kenneth Cha firing at Moore twice from a few feet away, after his partner, Officer Colin Patino, failed to subdue Moore with the baton strikes and was knocked to the ground. Police released a photo of Patino with his face bloodied from a blow to the nose.

Moore appeared to be moving forward, toward Cha, when he was shot. He survived and was charged by city prosecutors with assaulting a peace officer, making criminal threats, resisting arrest and other charges. He is being held on $2 million bail.

Police officials have said Moore punched Patino when he struck him with the baton and that he was shot when he advanced on Cha. According to family members, Moore, who was struck in the stomach and groin by bullets, has a history of paranoid schizophrenia that is known to officers in the area.

“This is a situation that could have and should have been avoided,” Adachi said at his news conference. “This is a situation where Mr. Moore did not have to be shot. If the officers had used de-escalation techniques, they could have gone home.”

Acting Police Chief Toney Chaplin said officers were dealing with a large suspect who had an unknown object in his hand and was at a physical advantage because he stood at the top of stairs.

“They did what they could to try and calm him down,” Chaplin said. “You can hear the officers clearly say, ‘He has something in his hand.’ Yet they did not default to gun. They used pepper spray, then they used a baton.”

The police force has been under pressure since the fatal December 2015 shooting of Mario Woods in the Bayview neighborhood, which was captured on video by witnesses.

Afterward, the Police Commission revised the Police Department’s use-of-force policy for the first time since 1995, putting more of an emphasis on de-escalation, and the U.S. Justice Department conducted a review of the department before issuing scores of reform recommendations.

Chief Greg Suhr resigned last year after a subsequent shooting, and his replacement, former Los Angeles Deputy Chief William Scott, is expected to be sworn in this month.

The video released by Adachi shows Moore at the top of the stairs leading to his front door, standing behind a security gate. He immediately responds to the officers in an aggressive manner, cursing them, using homophobic slurs and telling them to get off his steps.

Moore eventually opens the gate to grab the restraining order papers from the officers. An officer identified as Cha deploys pepper spray, and Moore appears to rear back to kick his hand, sending the spray onto Patino as well.

The officers retreat back down the stairs as Cha calls for medical help. The officers shout at Moore that they need the papers back, and that he is under arrest, shining a flashlight at him. Moore tosses the papers onto the stairs and complains he cannot see because of the pepper spray.

After Moore comes through the security gate, one officer twice shouts, “Get on the ground!” Moore remains standing and responds, “I ain’t gettin’ on s—.”

As an officer calls in information about Moore on his radio, Moore walks down a few steps and picks up the papers. Seeing this, an officer shouts, “Hey, come out! Get over here! Get on the ground!”

Patino then quickly climbs the stairs, as Moore retreats, and strikes Moore with his baton. Moments later, Patino is knocked back. Shortly after, Cha fires two shots from the stairs at Moore, who is in his doorway a few feet away.

“Shots fired, shots fired!” an officer shouts.

Police said Moore retreated into the house after being shot, and that hostage negotiators spent an hour attempting to coax him out before a tactical team entered to get him treatment.

His mother, Cleo Moore, said he had been moved recently from the hospital to jail.

“My son is not a very vicious person, he’s just struggling every day with mental illness,” she said Wednesday. “It’s unfortunate that it happened this way. My son did not need to be shot. ... It didn’t have to happen this way if the officers would have been trained in how to take care of mentally ill patients.”

Adachi said the video shows the officers escalating the situation by aggressively dealing with an already agitated man.

“If you look at basic de-escalation 101, you talk to the person, you try and get the person in a place where they are calmer, and if the person is making reasonable requests — in this case for the officers to step off his stairs — they could have done that without endangering themselves or Mr. Moore,” Adachi said. “There’s obviously a big gap between what the officers are being told at the academy and what is being done at the street.”

Adachi said he released the video, which his office received from the district attorney’s office as part of discovery in Moore’s criminal case, to push the Police Department toward transparency, one of the aims of the body-worn camera program.

Chaplin said the department would continue evaluating when to release body-camera footage on a “case-by-case” basis, in a way that would not jeopardize investigations or put witnesses or anyone else at risk.

“The lessons are still unfolding,” Chaplin said. “We don’t want somebody else’s politics or antics to dictate when we do what we do.”

Vivian Ho is a San Francisco Chronicle staff writer. Email: vho@sfchronicle.com

Twitter: @VivianHo