where I expect to see "commit message" but it isn't there → lost all changes, couldn't find a "reset" and probably didn't hit Undo early enough to undo the revert, so I tried to revert my revert for the sake of recovering my files → forgot some files, reverted to try to add them (oof, thought that it would do the equivalent of Undo since it was local) I also just lost a ton of work, and was wondering if this is related: I was able to go back to my "missing" commit via command line, even though the commit doesn't show up in desktop GUI History or in the command line git log. Additional Information LogsĮDIT: probably not the same issue since I never successfully used Undo. Undoing the original commit removes the changes from the Changes tab, so now it reflects what's on disk, and now there's data loss, as the change from step 1 is lost. So the Changes tab at this point is not reflecting the file on disk. If you only undo the revert commit, then view the file on disk, you'll see that it's back to the HEAD version, without the change from the commit in step 2, but the change is visible under Changes. I think this is the crux of the issue, as this is when things diverge between GitHub Desktop and the file on disk. When you undo the revert commit, the Changes tab shows the change from step 1 for that file, as if it's not committed by the commit from step 2, and the change is available to commit. This is the behavior that happens if you simply skipped step 3 and used undo on the commit from step 2. The change from step 1 should still be in the file. View file on disk, the change made in step 1 should be gone.There are now 2 local commits that haven't been pushed. Go to History tab, right-click on the local commit, 'Revert This Commit'.Make a commit for this change, but do not push, so that it stays local.We want to extend a huge thank you to for his work in helping make that a reality.Data loss can happen if you use the 'undo' functionality on a reverted local commit. Now in your commit history, you can choose to amend your last commit to update the commit message or add changes to the commit.įinally, with today’s release, users on Apple Silicon machines using the new M1 chip will upgrade to a native build of GitHub Desktop, improving performance and reducing crashes. If your working directory has a lot of existing changes and you just want to make a small change though, undo probably isn’t a great fit. GitHub Desktop has long included the ability to undo your last commit to place all of its changes back into your working directory. Now in Desktop, you can check out a new branch from any commit in your history, allowing you to easily view the state of your repo at that point in time while not negatively impacting the branch you’re working on. Many times, you may need to check out an older version of your project to investigate a bug or create a hotfix on top of your latest release. Start a new branch from an earlier commit When you merge, you also now have the option to squash and rebase as part of your merge.Īnd if commits are ordered in a way that’s disparate and hard to follow, now you can just drag and drop them wherever you’d like in your history. If a group of commits represents a single unit of work, or if a project requires that each pull request only has one commit, simply drag them on top of one another to squash them together and add a new commit message that captures the whole picture. Many developers care deeply about their commit history and use it to tell a coherent story about the progression of their project. There’s more of Git now in GitHub Desktop, allowing you to focus on what matters. We’re continuing that momentum and expanding drag and drop to allow you to squash and reorder commits in your history, amend previous commits, start new branches from earlier commits, and more. In GitHub Desktop 2.7, we released cherry-picking and introduced drag and drop, and in GitHub Desktop 2.8 we made several improvements to diffs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |