Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 8
    Just be careful, Since if you use force then there is no way to retrieve the previous commits since you removed it Commented Jul 3, 2019 at 0:28
  • Nice and quick solution, as for me.
    – B. Bohdan
    Commented Jul 3, 2020 at 6:53
  • 6
    Force is destructive. This is not squashing commits rather removing the last three commits and adding them back as a fourth (now new) commit, essentially rewriting the history which can break the repo for other users until they also force pull. This will also remove any other commits your team has pushed meanwhile. Commented Aug 31, 2020 at 10:26
  • What's the point of linking to BitBucket? Commented Jun 18 at 21:04
  • The git reset --soft answer was already given in 2011. What does your answer add to it? Commented Jun 18 at 21:05