The most studied pivots in startup history, Slack from a game called Glitch, Instagram from a location app called Burbn, share a pattern that is less discussed than the pivot itself: the founders kept the team intact and changed the product completely, rather than changing the team to save the product.
The distinction matters. A pivot that keeps the team preserves the institutional knowledge, the working relationships and the specific trust that takes years to build. The product is the thing that is wrong; the people are the thing that is right, and the successful pivots treated those two facts as separate.
What the failed pivots did
The pivots that failed did the opposite: they kept the product and changed the people, replacing the team that built the wrong thing with a team that would build the same thing slightly differently. The result, in almost every case, was a slightly better version of a product nobody wanted, built by a team that did not know why the first one failed.
The honest advice
If you are going to pivot, keep the people and change the product. The team that built the wrong thing is the team that understands why it was wrong, which is the knowledge the next product needs. Replacing them to preserve a product is the most expensive way to learn what they already knew.