If you accidentally commit to the wrong branch in Git, what command can help you move the commit to the correct branch?

  • git cherry-pick
  • git move-commit
  • git amend
  • git rebase
When you accidentally commit to the wrong branch, you can use git rebase to move the commit to the correct branch. This interactive rebase allows you to pick, edit, or squash commits, providing flexibility in rearranging your commit history.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *