DEV Community

loading...

Discussion on: Getting productive with git checkout

Collapse
oligospermia profile image
Mesalazine

You can also hard reset your new branch in case you forgot to provide starting point:

# when on <master>
git checkout -b new-awesome-feature
# <new-awesome-feature> is now at <master>
git reset --hard old-but-still-awesome-feature
# <new-awesome-feature> will now be at <old-but-still-awesome-feature>
Collapse
dzhavat profile image
Dzhavat Ushev Author

Oh, that‘s awesome! Will definitely use it. Thanks for the tip.