Okay, one more... Ever commit something only to immediately realize that you're on the wrong branch? Use "git move <branch>".
                                            Again, only one is necessary if you use proper commands like branch and reset.
"proper" 🤔 But, yes, branch instead of checkout -b, avoids the three checkout dance. branch/reset/checkout indeed works... like this:
                                            Why the "soft" checkout? My assumption would be the "incorrect" commit is not supposed to be on current branch and as such can be removed.
It's going to be removed when you checkout the other branch (it's gone if you return), but otherwise it unstages everything.
Hmmm. Should be able to include optional second argument to specify number of commits to "move", too. Bonus.
United States Tren
- 1. Cowboys 69.4K posts
 - 2. Nick Smith 16.1K posts
 - 3. Kawhi 4,503 posts
 - 4. Cardinals 31.2K posts
 - 5. #LakeShow 3,518 posts
 - 6. Jerry 45.9K posts
 - 7. #WWERaw 63.7K posts
 - 8. #WeTVAlwaysMore2026 658K posts
 - 9. Kyler 8,674 posts
 - 10. Blazers 8,246 posts
 - 11. Jonathan Bailey 28.8K posts
 - 12. No Luka 3,791 posts
 - 13. Logan Paul 10.5K posts
 - 14. Valka 4,998 posts
 - 15. Jacoby Brissett 5,776 posts
 - 16. Dalex 2,661 posts
 - 17. Pacers 13.4K posts
 - 18. Pickens 6,716 posts
 - 19. Javonte 4,442 posts
 - 20. Bronny 14.9K posts
 
Something went wrong.
Something went wrong.