Replace any commit with a different one, leaving other commits unchanged

git replace

  • Create, list, and delete refs to replace objects.
    More information: <https://git-scm.com/docs/git-replace>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

git replace {{object}} {{replacement}}

click the source code to copy install git replace on any operating system with command-not-found.com