Drupal, Flex, Sass,React, Website Development

Git commands that we all need to remember

You are here

Git is fantastic but there are times when you need to find that odd command because you have stuffed something up. Here are some I use on those occasions, firstly open the terminal and navigate to the root directory of the Git repo.

You didn't want to commit that

~$ git reset --soft HEAD~1

I want to remove the second last commit

~$ git rebase -i HEAD~2

The master branch commits have moved ahead from my-current-branch when I first branched off