
git diff xxxxx yyyyy - Difference between xxxxx and yyyyy.git stash pop - Restore changes stashed by 'git stash'.git stash - Move changes in directory out of the way (in order to 'pull' in changes).git remote -v - Shows remote repository (should be: origin git checkout filename - Reverts 'filename' to repository version.git push - Push your locally committed changes to remote repository.
GIT RESET ORIGIN UPDATE
GIT RESET ORIGIN DOWNLOAD

git branch backupĪ - B - C - D - E <- master <- HEAD, backup We want to reset our local master branch to match the remote HEAD(or the tip of the remote master branch). Let's assume that we have added two new commits(D and E) after cloning the repository. Now, consider our local repo contains five commits. Let's take an example to understand the above steps.Ĭonsider a remote repository with a single master branch and three commits. The -f flag will overwrite any default Git Clean configurations and clean up the untracked local files. The -d flag removes any untracked directories.

The -x flag will remove all untracked files and ignored build directories. The final step is to clean up some changes that may be present after the reset operation. Also, we have a local repository in which the origin/feature remote-tracking branch is lagging.

The remote name will be the origin, in most cases.įor example, consider a remote repository with two branches( master and feature). The above command adds a new branch pointing to the same commit as the master branch. git branch įor example, consider we have a master branch with three commits. After we reset the other branch, we will still have this backup branch to keep our commits safe. We will create a new branch pointing to the current state of our repository. In case we want these changes back, or if we want to compare some changes, or something else goes wrong, our work will still be safe. We do this to ensure that our current changes or commits are safe. Before we begin, let's back up our changes before resetting our branch.
