当前位置:网站首页>How does idea withdraw code from remote push
How does idea withdraw code from remote push
2022-07-04 09:14:00 【The fruit of it midsummer】
In normal development , We often commit some wrong code to the remote branch by hand , At this time, we want to withdraw quickly to avoid unnecessary problems caused by the error code being pulled by colleagues , Today we will demonstrate :
First of all, this is the code in my remote warehouse :

My local code :

operation : Hand error twice in a row ( First submission and second submission ) Submit the local error code to the remote warehouse
git Submit the record :(nio It's actually my first time to submit information. I mistakenly wrote it here , But it doesn't affect )

Local code records :
Remote warehouse records :

At this time, mistakes have been made , I have submitted the wrong code to the remote branch twice by hand , So how can I withdraw ?

At this time, find the submission you want to withdraw to , Right click to select (Reset Current Branch to Here). such as : I want the code to roll back to what it looked like when I first submitted , Just find my first submission nio Right click to select Reset Current Branch to Here Click to select the second one Mixed Click ok

At this time, you will find that your local code is still the same as before , But it shows no commit The state of .

Find your local change record at this time ( Is our usual code commit The box that pops out when )

Click on this. " Arrow returned " Roll back
Click on Rollback after , Our code will return to the way we first submitted .

But at this time, it is only local restore , The previously submitted error code is still on the remote . So we need to cover the code to the remote .
Because the previous operations are first update>>>>>push, But in our case , Will pull down the remote error code , Then our previous operations are in vain , So it needs to be enforced push. Although we didn't submit information at this time , But we can still choose to force push.

Be careful : At this time, I found idea mandatory push Button gray , So I changed it to command line coercion push.
git push origin HEAD --force

Finally, it is found that the remote code has been successfully overwritten 
边栏推荐
- How to pass custom object via intent in kotlin
- C语言-入门-基础-语法-数据类型(四)
- China battery grade manganese sulfate Market Forecast and strategic consulting report (2022 Edition)
- C language - Introduction - Foundation - syntax - [identifier, keyword, semicolon, space, comment, input and output] (III)
- Markdown syntax
- 随机事件的关系与运算
- Explain TCP protocol in detail three handshakes and four waves
- Dede plug-in (multi-function integration)
- 2022-2028 global edible probiotic raw material industry research and trend analysis report
- HMS core helps baby bus show high-quality children's digital content to global developers
猜你喜欢

Jianzhi offer 09 realizes queue with two stacks

Educational Codeforces Round 115 (Rated for Div. 2)

After unplugging the network cable, does the original TCP connection still exist?
![C language - Introduction - Foundation - syntax - [identifier, keyword, semicolon, space, comment, input and output] (III)](/img/89/0f5f4ba07c637b09abe873016cba2d.png)
C language - Introduction - Foundation - syntax - [identifier, keyword, semicolon, space, comment, input and output] (III)

Codeforces Round #793 (Div. 2)(A-D)

GoLand environment variable configuration

If you can quickly generate a dictionary from two lists

You can see the employment prospects of PMP project management

到底什么才是DaaS数据即服务?别再被其他DaaS概念给误导了

ArcGIS application (XXII) ArcMap loading lidar Las format data
随机推荐
After unplugging the network cable, does the original TCP connection still exist?
2022-2028 global optical transparency industry research and trend analysis report
Sequence model
What is uid? What is auth? What is a verifier?
awk从入门到入土(4)用户自定义变量
Awk from entry to penetration (6) regular matching
GoLand environment variable configuration
Reload CUDA and cudnn (for tensorflow and pytorch) [personal sorting summary]
Horizon sunrise X3 PI (I) first boot details
Turn: excellent managers focus not on mistakes, but on advantages
《网络是怎么样连接的》读书笔记 - 认识网络基础概念(一)
20220701 barbarat lemma proof
LinkedList in the list set is stored in order
How to batch change file extensions in win10
Launpad | 基础知识
[error record] no matching function for call to 'cacheflush' cacheflush();)
How do microservices aggregate API documents? This wave of show~
Basic discipline formula and unit conversion
Awk from entry to earth (14) awk output redirection
UML sequence diagram [easy to understand]