bhavya bojanapalli’s Post

View profile for bhavya bojanapalli, graphic

45K+ LinkedIn Family | Cloud & DevOps Engineer | Kubernetes | AWS | Ansible | GIT | Terraform | Gitlab | Docker | Python | Argo CD | Artifactory

🕎 GIT Revert vs GIT Reset git revert and git reset are two commands in Git used for different purposes, and they have distinct effects on your repository's history. 🏀 git revert: This command is used to undo a commit by creating a new commit that undoes the changes made by the specified commit. It's a safe way to undo changes because it doesn't alter the existing commit history. It's useful when you want to keep a record of the fact that you've undone a change. Example: 🏑 git revert <commit-hash> 🏀 git reset: This command is used to reset the current branch to a specific state. It can be used to move the HEAD and the branch pointer to a different commit, effectively "rewinding" the history. There are different modes of git reset, notably --soft, --mixed, and --hard, which determine what happens to the staged and working directory changes. 🔮 --soft: Moves the HEAD to the specified commit, but leaves the changes staged. 🔮 --mixed: Default behavior if no mode is specified. Moves the HEAD and unstages the changes, but leaves them in the working directory. 🔮 --hard: Moves the HEAD to the specified commit and discards all changes (staged and working directory) after that commit. Example: 🏑 git reset --hard <commit-hash> In summary, git revert is used to undo specific commits while preserving history, whereas git reset is used to move the current branch pointer to a different commit, potentially altering history. The choice between them depends on whether you want to preserve the history or not. #git #devops #commands #learning

  • No alternative text description for this image
Chanakaya Kamble

Analyst @ PowerLaw Pvt Ltd | Cloud DevOps Engineer | Helping Organizations Build Scalable Applications | AWS | LINUX | CI/CD | Jenkins | Ansible | Git | Github | Docker | Kubernetes |Terraform | Networking |

9mo

Thank you for sharing ....bhavya bojanapalli mam

Guru Sai Hima Bindu

System Engineer at Infosys Limited

9mo

Hello ma'am firstly thanks for sharing such knowledge on every concept it's really helpful......and also will you cover up Azure concepts as well !!!! Request from my side 😊

See more comments

To view or add a comment, sign in

Explore topics