If you’ve made a commit, but want to revert the commit and retain the file changes as unstaged, do the following: git reset –soft HEAD^ git reset HEAD
Tag: commit
Git – move accidental commits to a different branch
If you’ve been working on a common staging branch when you thought you were working on a personal feature branch, you can move your work by doing the following: git checkout feature_branch git cherry-pick SHA (Do this for each commit on the mistaken branch) git checkout staging git reset –hard HEAD~n (where n = the […]