Undo a local merge (not comited/pushed yet)
git reset --hard <last-commit-id>
Above command will move to the state of the last commit, ignoring all the changes.
If you want to push after a hard reset, use -f
option
git push origin <branch-name> -f
To checkout by folder
git checkout master -- db/migrate
To view all branches in local
git branch -a
To view all the branches in origin(remote)
git remote show origin
Stashing
http://git-scm.com/book/en/Git-Tools-Stashing
To push a new stash onto your stack
git stash
To see which stashes you’ve stored
git stash list
To apply stash
git stash apply
To remove a branch
From local
git branch -D <branchName>
From remote
git push origin --delete <branchName>
http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging
gitignore To remove added file from not to index git update-index --assume-unchanged db/schema.rb