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.
Loading...
Related Quiz
- When transitioning a legacy codebase to Git, it's important to set up a proper .git________ to ignore unnecessary files.
- In a code review, checking for _______ and _______ is essential to maintain code quality.
- To handle large files during a Git transition, the use of git _______ can be a solution.
- When you want to combine histories of multiple repositories, a git __________ can be a suitable approach.
- How do you resolve a merge conflict in Git?