Synced my fork with upstream using the UI, how to undo that? #46271
Replies: 18 comments 2 replies
-
Hi - I just did the same thing. Did you manage to find out how to revert the changes? I've lost 3 months of work ! |
Beta Was this translation helpful? Give feedback.
-
same here.. The git log is absolutly F*ed up (this is to teach you to never use the UI...) how the heck am I getting my last few days of work back? |
Beta Was this translation helpful? Give feedback.
-
Hey, yea I absolutely click through that button without thinking the branch. The commit history is completely gone and I cannot find SHA of the previous commit. Have you found a way to revert that changes? |
Beta Was this translation helpful? Give feedback.
-
Nope still not managed to solve this one. I even tried chatgpt but to no avail. At least not using the GUI. |
Beta Was this translation helpful? Give feedback.
-
There really ought to be a bigger warning on this button. It's so tempting to do and can really cause a clusterf*ck. |
Beta Was this translation helpful? Give feedback.
-
I just had the same issue, Hope it comes in handy. |
Beta Was this translation helpful? Give feedback.
-
I found a fix, but it only worked because I knew the commit hash for the HEAD of my branch before I pushed that stupid button:
This just makes the branch point back to where it did before. In my case that commit had become orphaned and I didn't have it locally, so I followed https://stackoverflow.com/a/34618633/2737626 to reattach it to some temp branch, so I could be able to fetch it. |
Beta Was this translation helpful? Give feedback.
-
Anyone has a better solution? I just had this problem now. |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue. Seems like CLI is the only way 😠😂 |
Beta Was this translation helpful? Give feedback.
-
Also lost all my work. The "Sync" button suggests that I SYNC changes and not destroy all my work.
|
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
I experienced the same issue. I lost all my work forever the moment I clicked 'sync fork' and then 'discard'. This is critical, and without a CLI or local branch, all work will be deleted. I'm disappointed that this hasn't been updated despite its significant impact. It's unfortunate that this ticket has been closed. Fortunately, I was able to download my previous work by browsing through the files in the canceled pull request. If the pull request had not been made, it would have been difficult to recover the work even by searching through various places. This requires a great deal of caution. Additionally, it would be better to modify the process to allow for duplicate pull requests. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
"This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions:" this is the way big tech companies get rid off their tickets instead of fixing their stuff. It is absolutely inacceptable that you can destroy all your changes with just one mouse click. The solution is super easy, just make that the sync button deos a "rebase", and all is fine, no data lost. GitHub, please either fix your stuff, or remove the button. |
Beta Was this translation helpful? Give feedback.
-
Hello, Here are some steps you can take to recover your work First, check your Git history to see if you can find the commits you need. You can do this by running If you find the commit you’re looking for, you can reset your branch to that point. Use the command To keep the current state while allowing for recovery, consider creating a new branch before you reset. You can do this with If you had pushed your changes to your remote fork before syncing, it’s worth checking there as well. Run If you still can’t find your commits, reaching out to GitHub support might be a good option. They have tools that could assist in recovering lost data. Lastly, for the future, it’s a good practice to maintain local backups or regularly push your changes to avoid similar situations. I hope this helps you recover your work. If you have any further questions, feel free to ask. Best. ^-^ |
Beta Was this translation helpful? Give feedback.
-
Hey, same problem here. It's possible to recover orphaned branches in the web UI if you have deployments enabled. Get the hash from the last good deployment and open that commit. Use the solution @pmishev found for creating a branch from that (click the branch dropdown and make a new branch). With that, hopefully you've saved your repo from this shithouse UI. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
Hi all
Synced my fork with upstream using the repository button "Sync Fork" UI in a hurry and it discarded many of my commits, how to undo that step?
I had checked these files on Git and the only copy lied there and do not have a local backup. Any tips on how to revert the sync fork step made on the UI?
Struggling to get my work back.
Beta Was this translation helpful? Give feedback.
All reactions