git scenarios

Karun Agarwal
Aug 15, 2023

Maintaining a list of scenarios we face with git in day to day work here and their solutions.

Git Logo

Revert your last commit and bring back to staging:

1. If it’s not your first commit in the repository,

git reset --soft HEAD^

2. If it’s your first commit in the repository,

git update-ref -d HEAD

Note: It will delete all of your commits and bring back everything to staging.

--

--