more git commands...!!!

Back

How to remove any directory locally and push the change.

$ git rm -r name_of_the_directory
$ git commit -m "message"
$ git push origin BranchName 



How to undo git add command

Sometimes, we index some file and then we want to undo the operation due to various reasons like the file has been deleted intentionally. 

So, for that, 

$ git reset -- fileName

Remember, -- is the most important thing


it will not work, if you will just do

$ git reset fileName