Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

commited to wrong branch

# undo the last commit, but leave the changes available
git reset HEAD~ --soft
git stash
# move to the correct branch
git checkout name-of-the-correct-branch
git stash pop
git add . # or add individual files
git commit -m "your message here";
# now your changes are on the correct branch
Comment

committed to wrong branch

git stash
git checkout branch123
git stash apply
Comment

commit to wrong branch git | move wrong commit to the correct branch


#source
#https://jasonmccreary.me/articles/made-git-commit-wrong-branch/


git reset HEAD~ --soft

git stash

git checkout destination-branch

git stash pop

git add .

git commit -m $MESSAGE
Comment

fix commit on wrong branch

download git history extension for vscode and manage you history

https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
Comment

commit to wrong branch git solution

# undo the last commit, but leave the changes available
git reset HEAD~ --soft
git stash -m "your stash message"
# move to the correct branch
git checkout name-of-the-correct-branch
#check the stash list first
git stash list 					//press q to  quit the 
git stash pop stash@{n}   		//where n is stash number to of your message
git add . 						//or add individual files
git commit -m "your message here"
# now your changes are on the correct branch
Comment

PREVIOUS NEXT
Code Example
Shell :: check chrome version ubuntu via terminal 
Shell :: check bios version cmd 
Shell :: docker rm all containers 
Shell :: uninstall material ui react 
Shell :: mongodb stop server mac 
Shell :: Reset git local branch to remote branch 
Shell :: remote origin already exists 
Shell :: linux check ram frequency 
Shell :: install pymysql 
Shell :: conda install openpyxl 
Shell :: install vlc in ubuntu 20.04 terminal 
Shell :: enabling ufw 
Shell :: find my ip mac terminal 
Shell :: linux list files by size mb 
Shell :: how to install beautifulsoup4 
Shell :: update ubuntu 
Shell :: install ninja ubuntu 
Shell :: nginx control process exited with error code 
Shell :: dos2unix recursive folder 
Shell :: command not found: lvim 
Shell :: how to check if solidity is installed 
Shell :: npm install redux and react-redux 
Shell :: crontab logs 
Shell :: install neovim 0.5 ubuntu 
Shell :: apt-add-repository command not found 
Shell :: how to uncommit my last commit in git 
Shell :: kill all processes by user 
Shell :: how to install postman in ubuntu 
Shell :: how to install and enable docker on command line with EC2 instance 
Shell :: mac install gpg 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =