git move recent commit back to staged 1

git move recent commit back to staged

git reset --soft HEAD^

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

Similar Posts