git notes
Show the commit message and short hash
alternatively:
Undo last commit
$ git commit -m "Something terribly misguided" # (0: Your Accident)
$ git reset HEAD~ # (1)
<< edit files as necessary >> # (2)
$ git add . # (3)
$ git commit -c ORIG_HEAD # (4)
Alternative:
Merge branches
Push to different remote branch
Fetch a file/folder from diffrent branch
To get package.json from dev branch to current branch:
Commit current changes to different (existing )branch
The first stash hides away your changes (basically making a temporary commit), and the subsequent stash pop re-applies them.
Commit current changes to new branch
Remove folder from entire git history
git filter-branch -f --tree-filter "rm -rf FOLDERNAME" --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
echo FOLDERNAME/ >> .gitignore
git add .gitignore
git commit -m "Removing FOLDERNAME from git history"
git gc
git push origin master --force