Some ways to recover code on Git

Git is a powerful tool for project management, most commonly used today. In some cases you need to recover the code, sleep code, blame. You will often encounter some of the following.

1. Just finished editing the code, haven't added it

2. Missed add hand but not committed

3. Commit, but haven't pushed yet

4. Commit, please push

Push it up, which means that there might be someone fetching to use, but people have already taken it, there is no recoil. In this case, you need to correct it: "Ah, I was wrong, get this."

Therefore, we push another commit, the content is the opposite of the one that was pushed to correct.

Conclusion

Git is a very powerful tool to control your source code.

The article is posted on your Blog ( Git – Restoring old full code ).

Glad to receive comments from everyone :))

ITZone via Kipalog

Share the news now