This was another test of the Phillies' emergency downcast system. Four days earlier, they dressed quietly in the visiting clubhouse at Nationals Park after watching what would have been their best win of the season dissolve into their worst loss.

Closer Hector Neris, after failing to retire any of the five batters he faced, was too distraught to talk about his second blown save of the season. Gabe Kapler, a manager who could find the positive in a 15-run loss, went right to the root of this defeat by pointing out that his relievers needed to do a better job of throwing strikes.

A series victory against white-hot Washington, the team that has won four of the last six N.L. East titles and is expected to win another this season, would have been such an uplifting experience for the Phillies, who have the youngest roster in baseball. Instead, they had to go home to face a San Francisco Giants team coming off a three-game sweep of the first-place Braves in Atlanta.

How would the Phillies react?

"I was pretty confident that that's the way they would react," Kapler said Thursday afternoon, following the Phillies' 6-3 victory that completed a four-game sweep of the Giants at Citizens Bank Park.

Perhaps, but four-game sweeps are extremely rare. The Phillies, in fact, only had two of them from 2012 through 2017, a time in team history that will best be forgotten. Now, they have two four-game sweeps this season – they took four straight from Pittsburgh last month – and a confidence that seems contagious.

Sure, the Phillies will admit they were down after that loss in D.C., but they are undaunted by defeat and deficits. In fact, they were down 3-0 against the Giants in the series finale, and it looked as though it might be one of starter Vince Velasquez's bad days. We've seen them before. Instead, Velasquez gathered himself after giving up a two-run homer to Alen Hanson in the second and retired 14 of the next 16 batters he faced, including 10 via the strikeout.

That gave the Phillies' offense time to respond, and it did so with a four-run fourth inning against Giants starter Ty Blach. The rally was capped by a three-run homer from Carlos Santana, who doubled his home run total for the season to six during the sweep.

"From the beginning we've been like this," Odubel Herrera said through a team interpreter after contributing three more hits to raise his major-league leading batting average to .353. "We all trust each other, and we have faith we can come back from a 3-0 deficit. That's the beauty of this game. We have good chemistry here, and we all support each other."

Chemistry can be difficult to define, but it is easy to recognize, and these young Phillies have shown they know how to handle adversity.

Their first encounter with it came when they returned home from their opening road trip of the season with a 1-4 record and a rookie manager who was so beleaguered that he was booed when he was introduced for the first time in his home park.

Kapler's team responded by winning five of six at home to climb above .500. They have remained there ever since, but they encountered more turbulence when they lost four straight series, including the disturbing one in D.C.

"Of course, games like the one in Washington, that's going to happen," Herrera said. "In the game of baseball, there are ups and downs. But you always have a chance to rebound and play better. We're not going to lose our motivation because of one game we could have won but didn't."

And so the Phillies responded with a sweep of the Giants, including a comeback in the finale. These Phillies might be different than the teams of the recent past. They are starting to believe they are talented enough to keep winning even after difficult-to-digest defeats.

"I feel as though this year is very different," Herrera said. "That's not only for myself, but everyone here. You can see that everyone is trying to feed off each other's performances, and it's different."

Kapler insists that does not surprise him. He sees a team that is talented, together, and that goes to the plate with a sound approach. For the umpteenth time Thursday, the manager celebrated the Phillies' ability to see pitches — a statistic his team has led the majors in since the start of the year.

"I'm going to continue to hit that theme," Kapler said. "The top four in our lineup see a ton. What that leads to is wearing down pitchers, and then it leads to maybe an Odubel big hit. Or today it led to Carlos Santana with a big home run."

It also led to another victory and more evidence that this Phillies team might, indeed, be different.