[⬅️ Back to Useful Rare Git Commands You Never Heard Of](./useful-rare-git-commands-you-never-heard-of.md) # git replace ![Category: History](https://img.shields.io/badge/Category-History-blue) > Temporarily substitute one commit for another. #### Command ```sh git replace abc123 def456 ``` #### Examples - **Temporarily replace commit abc123 with def456.** ```sh git replace abc123 def456 ``` #### Steps 1. Run `git replace ` to test or patch history. --- _Author: mike-rambil • Updated: 2024-06-10 • Tags: replace, history_