-2

I am new in GitHub And I have linked my android xyz project with GitHub previously. After sometime I use GitHub desktop for pushing code in GitHub. And I have copied the code from android studio and pasted it in the GitHub desktop directory where I have created new repository. And then I use push command. But one thing is that mistakenly I forgot to copy each files from android studio. But my android studio code gets updated with the new files and hence all the files which I forgot to copy gets deleted. I want to know how can I bring these files which exist before the push.

1 Answer 1

0

I am not sure to fully understand your problem but in Git, when you want to check the previous state of a document, you use the commit history. It is a feature generally available in your IDE (I added a link below for Android studio), online, in GH Desktop, or more traditionally via the CLI. If you are online on Github, you can access the commit history by clicking on the small rounded arrow available above your source code, which will take you to /yourrepo/commits/yourbranch. Some resources:

Lastly, you can check the entire state of a repo by clicking the following icon when you are online:

GH repo history

Hope that can help a bit.

Sign up to request clarification or add additional context in comments.

6 Comments

Actually I want to undo the last commit.
Can I explain in detail? Firstly I have done first commit after that I have done lots of changes in my code .And then I have done second commit.Now I want the data or changes which I had done previously.
Check the links I have shared. You simply need to revert your commits.
I am able to undo a commit.But not getting the old data.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.