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 get the group name of a project in gitlab 
Shell :: connect to host gitlab.com port 22: Connection refused deploy key 
Shell :: combine files with header bash 
Shell :: pip install ps_lib 
Shell :: array difference powershell 
Shell :: sed: 1: "package.json": extra characters at the end of p command 
Shell :: linux commans find only file name 
Shell :: pacman install openldap 
Shell :: login to github from terminal 
Shell :: DISABLE_DATABASE_ENVIRONMENT_CHECK=1 
Shell :: can you speak in linux commands 
Shell :: connaitre la taille fichier gz debian 
Shell :: PULSEUADIO to PIPEWIRE default.pa - pipewire.conf 
Shell :: cpickle 
Shell :: unorm npm 
Shell :: find command name specifc directories 
Shell :: GitHube commend line 
Shell :: git rm folder 
Shell :: pip install SSLComerz 
Shell :: PoweShell PingSweep 
Shell :: backup software move file from certain time 
Shell :: install mongodb klai 
Shell :: powershell check end of string 
Shell :: brew mac install cargo with toolchain 
Shell :: screen painting ubuntu 
Shell :: linux vga wake up screen 
Shell :: convert log file with unix timestamp 
Shell :: grep third line after match 
Shell :: ubuntu gdm at login keyboard stop working 
Shell :: start cinnamon from command line redhat 7 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =