Articles → GIT → Checkout Operation In GIT
Checkout Operation In GIT
What Does Checkout Mean?
Example
- Create an empty text file ‘1.txt’.
- Add ‘1.txt’ in git repository using the following command
Git add 1.txt
Git commit 1.txt -m “Committing 1.txt”
- Modify “1.txt” and add following text
- Commit the changes using the commit command
Git commit 1.txt -m “Commit 1.txt 2nd time”
- If we want to switch to previous commit then we can use checkout command
Git checkout bee90c23632f82095b8d3b831bf8266a32e1cbe1
Git checkout 95a6eeca9b742ba406ca611eac6bf6a30e98b4ef