Answers for "git revert last commit with merge"

4

git revert merge

git revert -m 1 <merge-commit>
Posted by: Guest on March-05-2020
1

revert last merge git

git revert -m 1 commit_hash
Posted by: Guest on May-07-2020
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

Browse Popular Code Answers by Language