4 not-so-basic Git situations and what to do

Nana Kwame (Na'ame) Owusu
The Startup
Published in
6 min readSep 19, 2019

--

Photo by Luke Chesser on Unsplash

Git is very popular in the software development industry, and beats its open-source competitor, Subversion (SVN), in performance, features and wide-ranging support and communities. After working as a software engineer for a few years, and migrating my team from RTC to Bitbucket, Git definitely takes the cake for me in terms of being accessible, efficient and adaptable for a wide variety of use cases. These positive attributes usually come with complexity, especially for new developers starting to get familiar with Git. It certainly took me a few swings at the bat to get comfortable with some of the not-so-basic but necessary commands and I highlight a few of these below.

1. Where is the ‘undo’ button?

We are all familiar with the usual git workflow happy path:

But what happens if there is an issue at any of these steps? How do you undo at each point in the path?

Here’s how:

Undoing unstaged changes in your workspace

git clean: Removes all files that have not yet been placed under version control. This can be an easy way to undo any working directory changes in all unversioned files at the same time.

--

--