This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git reset --soft HEAD^ -> undo last commit and save changes | |
| git reset --hard HEAD~1 -> undo last commit and remove changes | |
| git reset --hard HEAD~2 -> undo 2 last commits and remove changes | |
| git revert commit-hash -> create new commit which reverts last commit | |
| git checkout . -> remove all uncommitted changes | |
| git checkout filename -> undo changes in specific file | |
| git clear -df -> remove all untracked files | |
| git rm filename -> remove file from index, after your did git add filename | |
| git commit --amend -> change message of last commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // original from:https://codepen.io/mdd/pen/wGRqbw | |
| // Reducer | |
| const counter = (state = 0, actions) => { | |
| switch (actions.type) { | |
| case 'INCREMENT': return state + 1; | |
| case 'DECREMENT': return state - 1; | |
| default: return state | |
| } | |
| } |