Skip to content

Instantly share code, notes, and snippets.

@jandrodev
Created January 17, 2023 06:42
Show Gist options
  • Save jandrodev/fba3bea5a2a19774c0a8d1f5d8be618e to your computer and use it in GitHub Desktop.
Save jandrodev/fba3bea5a2a19774c0a8d1f5d8be618e to your computer and use it in GitHub Desktop.
Git - Move last pushed commit from branch a to branch b
// Move last pushed commit from branch a to branch b
git checkout b
git cherry-pick $commitHash
git push origin b
git checkout a
git rebase -i HEAD~1
git push -f origin a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment