Answers for "how to reset last merge to previous commit git"

0

how to reset last merge to previous commit git

//run git log
//output may look something like this:

Author: raybags <[email protected]>
Date:   Wed Jul 21 12:43:17 2021 +0200

    debugging redirects

commit 353f4990b4f7d310ff3d6bd79e736d22fda4add1
Author: raybags <[email protected]>
Date:   Tue Jul 20 21:26:59 2021 +0200

    impliment redirects for deployment

commit 216fa3a0b0c1c82cb415a317a16e2c232bdb6b84
Author: raybags <[email protected]>
Date:   Tue Jul 20 21:25:19 2021 +0200

//Select the "commit id" of the 2nd last commit your want to revert your master branch to
//i.e 353f4990b4f7d310ff3d6bd79e736d22fda4add1 (copy to clip bord)

//then run 

git reset --hard 353f4990b4f7d310ff3d6bd79e736d22fda4add1

This will reset your master branch to its prevous state discadding all recent changes.

***goodluck***
Posted by: Guest on July-24-2021

Code answers related to "how to reset last merge to previous commit git"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language