简体   繁体   中英

Reset pushed changes git repository

I had accidentally committed and pushed modifications to some files to a branch on bitbucket. When I wanted to remove these files from the commit I used the rm command and ended up deleting the files. What I am trying to say is, I ended up deleting the files instead of removing the modifications on them. I tried using git reset but that only resets my latest commit, while the wrong commit/push was several points backwards. Any ideas?

You need to execute following commands:

(if there are no changes, that were submitted after your push) 1. Reset your changes: git reset --hard 2. Update origin: git push origin -f (it will force push your changes).

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