GIT Commands
GIT Commands
git fetch // fetch changes from remote repository but must be merged to see changes
git merge // merge changes that was fetched by git fetch command
git remote add myremote url //this command will add remote repo in local repository
To delete Branch:
Local Delete
Git branch -d master
Remote delete:
Git branch -dr origin/master
To delete from remote repository:
Git push origin –delete master
To Restore Changes:
For non-Committed Files
Git checkout HEAD file/to/restore for single file
Git reset –hard HEAD to restore all
For Committed Files
Git revert <commit hash>
Git reset –hard<commit hash>
Git reset –keep<commit Hash> to restore but keep the changes as uncommitted changes
Git push -f origin master ////force push