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 Trendy
- 1. Game Day 33.4K posts
- 2. Christmas 118K posts
- 3. #SaturdayVibes 3,687 posts
- 4. vmin 36.4K posts
- 5. Big Noon Kickoff N/A
- 6. Social Security 49.5K posts
- 7. Good Saturday 24.2K posts
- 8. Disney 91.9K posts
- 9. ESPN 80.1K posts
- 10. Nigeria 487K posts
- 11. #AllSaintsDay 1,468 posts
- 12. New Month 317K posts
- 13. #saturdaymorning 1,659 posts
- 14. #River 5,527 posts
- 15. #SaturdayMotivation 1,321 posts
- 16. VOCAL KING TAEHYUNG 43.5K posts
- 17. MEET DAY 10.8K posts
- 18. Texas -3 99.3K posts
- 19. Hulu 33.2K posts
- 20. Chovy 14.6K posts
Something went wrong.
Something went wrong.