Git rest & revert deep dive | Git revert vs reset Demo | Git tutorial | Java Home Cloud
Vložit
- čas přidán 15. 06. 2024
- Register for Online Training 👉 bit.ly/3vuBQqb
Git revert and git reset are two Git commands used to undo changes in a Git repository, but they work differently.
Git revert is a command that creates a new commit that undoes the changes made by a previous commit. It is a safe way to undo changes in Git, as it does not modify the commit history. Instead, it adds a new commit that contains the opposite changes to the ones in the commit you want to undo. This means that the commit history is preserved and that you can revert the revert later if you need to.
Git reset, on the other hand, is a command that modifies the commit history by moving the branch pointer to a previous commit. It allows you to discard changes made after a specific commit and to reset the repository to that commit's state. This means any commits made after the reset commit will be removed from the repository's commit history.
📞 WhatsApp Us: wa.me/+919886611117
Instagram / javahomecloud
LinkedIn / javahomecloud
Website 👉 javahome.in/
✨ Popular Playlist ✨
AWS Lambda, Python & Boto3 👉 shorturl.at/brx69
Terraform FAQs 👉 shorturl.at/fuILT
Jenkins Tutorial 👉 shorturl.at/CKR37
🏛️ Courses Offer By Java Home Cloud 🏛️
Courses offered 👉 bit.ly/457HlHc
📹 Udemy Courses 📹
Terraform 👉 t.ly/eEv1x
Boto3 👉 t.ly/IOZIm
AWS CloudFormation 👉 t.ly/fenbh
Jenkins 👉 bit.ly/48lDI34
Subscribe to my Channel / @javahomecloud
Hello Sir, the best explanation I have seen so far about git revert and git reset. Thanks and keep up the good work 👍
Glad it helped
🌟 Welcome to Java Home Cloud 🌟
Register for Online Training 👉 bit.ly/3vuBQqb
🌐Website 👉javahome.in
You can use git reset and do a force push.
brilliant. thank you
Nice tutorial
Thank you! Cheers!
Thats on op video
SIr, can we able to revert it to a specific commit we want using revert command?
In our case, we are just reverting the most recent commit that we made.
try git revert command to revert any arbitrary commit
git revert
Man, you can push the removal of a commit using -force. That local vs remote idea is just wrong. You want git revert because you want to keep track of the reverted changes. Not pushing resets is just a best practice, it’s not impossible.
There is no git rest command, plz correct it
Its there Dhiraj,
git-scm.com/docs/git-reset
Yes @Dhiraj you are correct there is no 'rest' command, 'reset' command is there