How to revert GIT to a previously submitted version?

1. View the current branch: GIT status

2. Switch to the specified branch: GIT Checkout Dev

3. View the push history in the branch log: GIT

4. After getting the hash value, respond to the release version: git reset -hard plus

Note: git reset – soft and git reset – hard (careful operation if it’s not your own branch):
GIT RESET -Soft: After returning to the state after a certain execution, the files in the working directory will not be changed.
Git reset -hard: Go back to the specified version, it will reset the staging area and the icon in the workspace will revert to this version.

5. Push the modified local push to a remote warehouse: GIT push -f -u origin dev dev

-F: Force reduction indicates a forced push to a remote warehouse
Currently if you are using “git push”

6. Expand

GIT RESET: It is restored to a previously submitted version, and a version submitted after this version is not needed.
Git revert: If you want to revert a previous version, but if you want to keep a version after the target version, make a note of the full version of the change.
For specific content, please see

Leave a Comment