Let's say you were working on an update but needed to push some partial code. To do it, you can quickly call the interactive add feature of git and select the portion of code you want.
If you made `git reset --hard` by mistake, possibilities are you can still get your commit back, as git holds a log of everything for a few days.
Let's say if you set the origin as the wrong repository URL of your git project, and you want to change the remote URL of the origin to the correct one.
So imagine that you blindly committed some changes with `git commit -a`, and you are not satisfied with the particular content of the commit you just created.
Sometimes, you would want to remove a specific file or part of the code from your last commit.
While working with teams, there is a good chance of screw-ups. There can be any mistake. One of the most common is leaving conflict markers somewhere. Finding these markers can be tedious if you have a large repository.
Git branches are an essential part of your daily development process, but once you or your team have finished with a feature and merged it into your remote’s main branch, you would want to delete that branch from your local repo and your remote.