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

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

PREVIOUS NEXT
Code Example
Shell :: enter 1 digit max number field 
Shell :: puppet install on centos 7 
Shell :: c# dotnet install Microsoft.Office.Interop.Excel 
Shell :: ubuntu enable ssh 
Shell :: pm2 logs 
Shell :: grep output to file 
Shell :: win kex kali linux 
Shell :: ls order by filename length 
Shell :: unporotected ssh key aws 
Shell :: ubuntu open with software install not working 
Shell :: docker history 
Shell :: git init 
Shell :: how to install bwa in ubuntu 
Shell :: download specific folder from git 
Shell :: linux user groups 
Shell :: git log with date and author info 
Shell :: copy files from certain date linux 
Shell :: git patch staged to file 
Shell :: how to install redux 
Shell :: how to know expire date for user linux 
Shell :: stash pop single file 
Shell :: how to add line number to a file 
Shell :: get library list linux 
Shell :: linux make file 
Shell :: Composer install with dockerfile 
Shell :: linux keyboard layout cli 
Shell :: push an existing git repository 
Shell :: yum install gcc 
Shell :: bash test if in interactive shell 
Shell :: how to zip folder on linux 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =