Web dev

The top 10 most useful git commands

1. How to remove last commit

2. How to edit an incorrect commit message

or

3. How to “Undo” a wrong git add

4. How to delete a git branch locally and remotely

5. How to rename a branch

or if you are on the branch you want to rename

6. How to remove local (untracked) files from the current git branch

show the file before to remove then with

physically remove files with

physically remove directories with

7. How to temporary switch to an old commit

8. Resolve merge conflict

9. Force a git pull to overwrite local changes

10. How to show a list of remote and local available branches

 

Leave a Comment