TORONTO — Boston Bruins Coach Bruce Cassidy has been full of surprises in this playoff series against Toronto.

In Game 1, he scratched veteran David Backes. That result did not go so well.

Bruins forward David Pastrnak, right, and goaltender Tuukka Rask celebrate after Boston’s 6-4 win in Toronto on Wednesday where Pastrnak scored his first two goals of the series, which is now tied 2-2. The Canadian Press/Frank Gunn, via AP

Then on Tuesday the coach declared that he was going to keep the top line of Brad Marchand, Patrice Bergeron and David Pastrnak together – at least to start the game – despite the difficulties it was having against the Maple Leafs’ No. 1 line.

Then, before Game 4 on Wednesday night, Cassidy proved he’s not above a little gamesmanship.

In the pregame warmup he had Pastrnak on the top line. But to begin the game, Cassidy decided to bump up Danton Heinen to play with Bergeron and Marchand and moved Pastrnak to the David Krejci-Jake DeBrusk line. He also picked his spots during the game to reunite the big line.

And it looks like Cassidy has his mojo back. Heinen assisted on Marchand’s early goal that gave the Bruins an early 2-0 lead. And in the second period, after the Bruins blew that lead, Cassidy put Pastrnak back with Bergeron and Marchand after the Leafs took an icing. On that shift, Marchand set up Pastrnak for his first goal of the series to put the Bruins back up, 3-2.

That seemed to cure whatever brain cramps had been ailing the first power-play unit. For when they got an opportunity after Auston Matthews took a bad offensive zone roughing penalty against Charlie McAvoy, Pastrnak picked up his second goal of the game, again off a Marchand assist

. The Marchand-Bergeron-Heinen grouping was also on the ice in the third period when Zdeno Chara scored what would be the game-winning goal with Bergeron battling for space in front of the net.

That put the Bruins up 5-2 at 5:39 of the third period. There would be some very tense moments after that, but Joakim Nordstrom finally put it away with two seconds left. Now, in what amounts to a best-of-three, they’ve taken back their home ice advantage with the nail-biting 6-4 win at Scotiabank Arena.

Cassidy said he made the decision to break up the top unit on Wednesday, and it hinged on the health of Marcus Johansson, who missed Games 2 and 3 with an illness.

“We were thinking about it (Tuesday), but part of the problem was ‘Where was Marcus? Was he in or out?” said Cassidy. “We made a decision this afternoon once Marcus got through morning skate and once he was good to go, that’s what we were going to do.”

But the Bruins still went through the ruse of the pregame warmup, Heinen skating on Charlie Coyle’s line.

“I was just told to warm up on that line and then got put over on the Marchy’s line,” said a grinning Heinen, who’d already been told in the morning that he was getting the bump up. “It is what it is. That’s his stuff to think about and we just have to get ready to play with whoever we’re going to play with.”

Cassidy said the main goal in breaking up the top line was to get Pastrnak going. He had not scored in the series and not creating much of anything with exception of Marchand’s goal in Game 2. There was also a certain comfort level with Heinen playing on that line after he filled in admirably for Pastrnak while the star right wing was out with a thumb injury.

“We’re just moving Pasta around. He wasn’t on top of his game for whatever reason,” said Cassidy. “Heinen has played with Bergy and March when Pasta missed four or five weeks. He did a good job up there, tailed off a little at the end. I’m not sure Danton can sustain it at this point in his career every night against the top lines and top D, but he certainly does a nice job in spots. Pasta and Krech have played together so it was just a different look. Johansson’s back in so that gives us some balance on the third line, a threat to score with Charlie (Coyle), a little more than what we had.

“Just moving some pieces around and hopefully gives us a spark. And maybe make them think and affect how they do things. I don’t think it did. I think they just played their game at the end of the day. We still got Pasta back with Bergy a little bit, certainly on the power-play and few 5 on 5 shifts. It worked out today.”

It was hardly perfect on Wednesday night. The Bruins gave up a whopping 42 shots. Tuukka Rask would have liked at least one of the four goals back. They blew a two-goal lead and nearly a three-goal advantage. The fourth line seemed to have blown a tire in Toronto. This series is still very much in question.

But on a night when they had to outscore one of the most explosive teams in the league, Cassidy and his charges found a way to get it done.