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 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 :: how to uninstall all powershell modules 
Shell :: give root permission to program linux 
Shell :: zip entire directory ubuntu 
Shell :: vscode tab not working ubuntu windows 
Shell :: how install pandas in python 
Shell :: ubuntu output to file and terminal 
Shell :: -bash: screen: command not found 
Shell :: switch to remote branch git 
Shell :: git unadd all files 
Shell :: ping with timestamp 
Shell :: linux link file 
Shell :: ngrok download authtoken 
Shell :: mac terminal unzip to directory 
Shell :: magento 2 configure cron command line 
Shell :: calculate float division 
Shell :: bash sh: line [: too many arguments 
Shell :: how to install spotify in linux 
Shell :: intall docker ubuntu command 
Shell :: kafka set retention time for topic 
Shell :: putty zip command 
Shell :: linux login to github via git 
Shell :: how to install packages from github in flutter 
Shell :: make current branch master 
Shell :: install kotlin ubuntu 
Shell :: remove upstream git 
Shell :: ssh login windows 
Shell :: bash print binary file 
Shell :: aws folder permission denied 
Shell :: Linux Mint reset xfce-panel 
Shell :: how to install dpkg in ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =