Github mistake #114293
Unanswered
itsmanishgautam
asked this question in
New to GitHub
Github mistake
#114293
Replies: 1 comment
-
It seems like the work you want to recover is in the commit git checkout cd95d6d
# If you want to start a new branch from this commit:
git checkout -b new-branch-name This command will switch your repository to how it was at that commit. After confirming that your files are as you expected, you can then create a new branch from this point to continue your work. Caution with Git commands, particularly those that alter your commit history. Always remember to back up your work to prevent any accidental data loss. Best wishes in recovering your work! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Github mistake
I didnot know what i did. but i just deleted all my files . a day before i commit directly to main. i now create a branch , commit , goto main and then merge branch to main and push. i accidentally deleted all my latest work. then i am with old data. it only shows one commit in git log of lastnight which was my first commit of project.
*jobsearch is project name
dbc0f6f (HEAD -> main, origin/main) HEAD@{0}: checkout: moving from branch1 to main cd95d6d (branch1) HEAD@{1}: commit: add job and notification dbc0f6f (HEAD -> main, origin/main) HEAD@{2}: checkout: moving from main to branch1 dbc0f6f (HEAD -> main, origin/main) HEAD@{3}: checkout: moving from main to main dbc0f6f (HEAD -> main, origin/main) HEAD@{4}: commit (initial): jobsearch
PS C:\Users\gunar\OneDrive\Desktop\Coders\JobSearch> git reset --hard HEAD~ undo cd95d6d (branch1) HEAD@{1}: commit: add job and notification dbc0f6f (HEAD -> main, origin/main) HEAD@{2}: checkout: moving from main to branch1 dbc0f6f (HEAD -> main, origin/main) HEAD@{3}: checkout: moving from main to main dbc0f6f (HEAD -> main, origin/main) HEAD@{4}: commit (initial): jobsearch
Beta Was this translation helpful? Give feedback.
All reactions