Unstage a file without overwriting changes.
git reset [file]
Undo any changes introduced after the specified commit.
git reset [commit]
This pushes the LOCALBRANCHNAME
to your REMOTENAME
, but it is renamed to REMOTEBRANCHNAME
.
git push [REMOTENAME] [LOCALBRANCHNAME]:[REMOTEBRANCHNAME]
Forces the push even if it results in a non-fast-forward merge. Be sure that nobody has pulled the commits before using the --force option.
git push [remote] --force
Pushes all of the local branches to the remote repository.
git push [remote] --all
Pushes the spesific tags from the local branches to the remote repository.
git push [REMOTENAME] [TAGNAME]
Pushes all tags from the local branches to the remote repository.
git push [remote] --tags
Note that there is a space before the colon. The command resembles the same steps you'd take to rename a branch. However, here, you're telling Git to push nothing into BRANCHNAME on REMOTENAME. Because of this, git push deletes the branch on the remote repository.
git push [REMOTENAME] :[BRANCHNAME]