DEV Community

Git: How to move misallocated commits

miku86 on November 12, 2019

Accidentally, I committed 6 times into master instead of creating a new branch. One wrong commit wouldn't be painful, I would do a simple git rese...
Collapse
 
mygeen profile image
Mygeen • Edited

Alternatively you can use git reset --hard origin/master in step 3. This resets the status of the local repository to the state of remote.

Collapse
 
miku86 profile image
miku86

@mygeen ,

awesome, thanks for this information.
If you want to use it, first check if your remote is at the proper state.

Collapse
 
greatbahram profile image
Bahram Aghaei

Creative alternative.

Collapse
 
atilafullstack profile image
Atila Augusto 🛡️

And if i do that in remote?