Tag Archives: git

How to undo git add before commit

How to undo git add before commit

In this article lets understand how to undo git add before commit. There are times when we have added few files via git add and not committed yet and now we don’t need to stage them for commit. So, we can do this using “git reset” command. Let’s understand how to do that step by …

How to rename a git branch

How to rename a git branch

In this article lets understand how to rename a git branch. So, there can be two types of situations where you will have only local branch to rename or the branch you have already pushed to the remote repository. Let’s understand how to do it. Follow below steps: 1 ) Move to another branch. Although …

How to delete git branch locally and remotely

How to delete git branch locally and remotely

In this article lets understand how to delete git branch locally and remotely. So, there can be two types of situations where you want to delete specific branch from git. Such as, Let’s understand both one by one. 1 ) Delete the branch locally: Check below command to remove local branch. There is one more …

How to undo last commit in git

How to undo last commit in git

In this article lets understand how to undo last commit in git. There are times when we have committed few changes to git but then realized we didn’t need them and had to reset last changes. Manipulating with commit in such situations is a big headache. But if you have understood the git commits it …