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 Trends
- 1. New York 903K posts
- 2. Virginia 478K posts
- 3. #DWTS 38.5K posts
- 4. Mamdani 1.14M posts
- 5. Sixers 12.4K posts
- 6. Bulls 33.3K posts
- 7. Embiid 5,903 posts
- 8. Maxey 7,698 posts
- 9. Jay Jones 90.5K posts
- 10. Cuomo 375K posts
- 11. #Election2025 14.7K posts
- 12. Prop 50 154K posts
- 13. Andy 63.2K posts
- 14. WOKE IS BACK 25.4K posts
- 15. Josh Giddey 5,132 posts
- 16. Whitney 11.1K posts
- 17. #SeeRed 3,118 posts
- 18. Louisville 129K posts
- 19. Alix 7,193 posts
- 20. #BlueWave 2,491 posts
Something went wrong.
Something went wrong.