Getting Geeky with Git #9. Understanding The Revert Feature

Getting Geeky with Git #9. Understanding The Revert Feature

Getting geeky with Git #9. Understanding the revert feature. When working on our project with Git, we might commit some code that we are not happy with. When reverting, Git analyzes the changes we want to undo.

  • 1.  Getting geeky with Git #1. Remotes and upstream branches
  • 2.  Getting geeky with Git #2. Building blocks of a commit
  • 3.  Getting geeky with Git #3. The branch is a reference
  • 4.  Getting geeky with Git #4. Fast-forward merge and merge strategies
  • 5.  Getting geeky with Git #5. Improving merge workflow with rebase
  • 6.  Getting geeky with Git #6. Interactive Rebase
  • 7.  Getting geeky with Git #7. Cherry Pick with Reflog
  • 8.  Getting geeky with Git #8. Improving our debugging flow with Bisect and Worktree
  • 9. Getting geeky with Git #9. Understanding the revert feature

Sometimes, when working on our project with Git, we might commit some code that we are not happy with. One of the solutions that Git provides to undo that is the revert feature. This article looks into how it works and what we need to look out for when using it.

The idea behind Git Revert

While we might be tempted to think of the revert feature as a means of undoing our work, this is not the complete picture. When reverting, Git analyzes the changes we want to undo. Then, it creates a commit on top of them that reverses the changes.

touch index .js

echo "console.log('Hello world')" > index .js

git add . / index .js

git commint - m "Added the index.js file"

Above, we’ve created the  index . js file add committed it to the repository. Let’s take a look at the log.

git log

git

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Best Practices for Using Git

Git has become ubiquitous as the preferred version control system (VCS) used by developers. Using Git adds immense value especially for engineering teams where several developers work together since it becomes critical to have a system of integrating everyone's code reliably.

7 Best Practices in GIT for Your Code Quality

Git plays a significant role in software development. It allows developers to work on the same code base at the same time. Check out 7 best practices for Git.There is no doubt that Git plays a significant role in software development. It allows developers to work on the same code base at the same time. Still, developers struggle for code quality.

Git Commands You Can Use To Dig Through Your Git History

Git Commands You Can Use To Dig Through Your Git History. In this short article, we’ll be exploring some quick git commands that can help us in digging through our repositories’ history of commits.

Git Rebase Tutorial and Comparison with Git Merge

In this article, I will explain to you a few differences between git merge, git rebase, and the git interactive rebase.I will tell a bit about what pros...

Mirroring Git Changes From One Server to Another Server

Hello all, nowadays most of the development teams using GIT version control, some of you may have a requirement of mirroring your team's git changes from one server to another Git server. This article will help you to achieve the Git mirroring between one server to another server.