git revert one commit 1

git revert one commit

 git reset --soft HEAD~1

Here is what the above code is Doing:
1. git reset –soft HEAD~1
– This will reset the current branch to the previous commit.
– The –soft flag will keep the changes in the working directory.
2. git add .
– This will add all the changes to the staging area.
3. git commit -m “Your commit message”
– This will commit the changes to the staging area.

Similar Posts