简体   繁体   中英

How to back out commits in GIT repository on DevOps

How do I back out commits made in GIT repository on DevOps. Other than manually changing back the code and re-pushing/committing for deployment I am unable to successfully carry this out within the GIT repository on DevOps. I have tried the various features within the repository but cannot quite get it right.

For example - I am on Build 370 but would like to roll back to Build 365, deleting the changes made since.

What you can do is:

  • Clone the repository (or use a local clone that you have)
  • Run git reset --hard Build365 (or whatever the SHA hash is)
  • Run git push -f *repository* HEAD:*master* (or whatever the branch is)

The force push will require that you have force push permissions on the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM