当前位置:网站首页>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 
边栏推荐
- Global and Chinese markets of thrombography hemostasis analyzer (TEG) 2022-2028: Research Report on technology, participants, trends, market size and share
- awk从入门到入土(15)awk执行外部命令
- awk从入门到入土(6)正则匹配
- Report on research and investment prospects of polyglycolic acid industry in China (2022 Edition)
- awk从入门到入土(12)awk也可以写脚本,替代shell
- Global and Chinese trisodium bicarbonate operation mode and future development forecast report Ⓢ 2022 ~ 2027
- In depth investigation and Strategic Research Report on China's motion controller Market (2022 Edition)
- Global and Chinese markets of water heaters in Saudi Arabia 2022-2028: Research Report on technology, participants, trends, market size and share
- Flutter 小技巧之 ListView 和 PageView 的各種花式嵌套
- There are 100 people eating 100 apples, one adult eating 4 apples, and four children eating 1 apple. How can they eat exactly 100 apples? Use any high-level language you are familiar with
猜你喜欢

HMS core helps baby bus show high-quality children's digital content to global developers

C language - Introduction - Foundation - syntax - data type (4)

GoLand environment variable configuration
](/img/3f/4d8f4c77d9fde5dd3f53ef890ecfa8.png)
C語言-入門-基礎-語法-[運算符,類型轉換](六)

2022-2028 global optical transparency industry research and trend analysis report

地平线 旭日X3 PI (一)首次开机细节

Codeforces Round #803 (Div. 2)(A-D)
![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)

2022-2028 global tensile strain sensor industry research and trend analysis report

2022-2028 research and trend analysis report on the global edible essence industry
随机推荐
At the age of 30, I changed to Hongmeng with a high salary because I did these three things
《网络是怎么样连接的》读书笔记 - FTTH
Launpad | basic knowledge
Awk from entry to earth (12) awk can also write scripts to replace the shell
Educational Codeforces Round 119 (Rated for Div. 2)
Jianzhi offer 09 realizes queue with two stacks
Flutter tips: various fancy nesting of listview and pageview
地平线 旭日X3 PI (一)首次开机细节
2022-2028 global visual quality analyzer industry research and trend analysis report
C语言-入门-基础-语法-[标识符,关键字,分号,空格,注释,输入和输出](三)
Launchpad x | mode
Awk from digging into the ground to getting started (10) awk built-in functions
The 14th five year plan and investment risk analysis report of China's hydrogen fluoride industry 2022 ~ 2028
Talk about single case mode
AMLOGIC gsensor debugging
If you can quickly generate a dictionary from two lists
【无标题】转发最小二乘法
Report on research and investment prospect prediction of China's electronic grade sulfuric acid industry (2022 Edition)
[C Advanced] file operation (2)
Awk from entry to earth (8) array