Understanding some useful GIT commands.

Stashing in GIT

git stash
git stash push
git stash apply
git stash pop
git stash show
git stash list
stash@{0}: WIP on feature/TE-4312: 61307eaca last commit message on feature/TE-4312 branch
stash@{1}: WIP on feature/TE-4513: bba77bd0a last commit message on feature/TE-4513 branch
stash@{2}: WIP on feature/TE-1234: dc42acaf1 last commit message on feature/TE-1234 branch
git stash pop {stash-id}
git stash push {filepath}
git stash push {filepath1} {filepath2} ... {filepathN}
git stash clear

Resetting branch

git reset --hard {commit-id}
git reset --hard HEAD
git reset --hard HEAD^
git reset --soft {commit-id}
git reset --mixed {commit-id}
git reset {commit-id}

Reverting commit

git revert {commit-id}

Fetching remote branches

git fetch --all
git clean -d -i
git clean -d -n {src}
git clean -d -n -X

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store