git pull but keep local changes code example
Example 1: keep local changes and pull
git stash
git pull
git stash pop
Example 2: git revert commit but keep changes
git reset HEAD^
git stash
git pull
git stash pop
git reset HEAD^